| 1 |
Dynamic Client Registration |
| 2 |
=========================== |
| 3 |
|
| 4 |
Support for Dynamic Client Registration (`RFC 7591 |
| 5 |
<https://www.rfc-editor.org/rfc/rfc7591>`_) can be turned on via |
| 6 |
``IDP_OIDC_DCR_ENABLED``. Once enabled, clients can register themselves by |
| 7 |
POSTing their metadata to ``/identity/o/api/clients``. |
| 8 |
|
| 9 |
Whether or not creating clients requires authorization is configurable via |
| 10 |
``IDP_OIDC_DCR_REQUIRES_INITIAL_ACCESS_TOKEN``, which is ``True`` by default. |
| 11 |
When authorization is enabled, the bearer token from the ``Authorization: Bearer |
| 12 |
<token>`` header will be used to lookup a token |
| 13 |
(``allauth.idp.oidc.models.Token``) of type ``Token.Type.INITIAL_ACCESS_TOKEN``. |
| 14 |
|
| 15 |
The DCR specification does not specify anything about the lifetime of the |
| 16 |
initial access token, neither does the allauth implementation. If you want to |
| 17 |
enforce specific rules, such as limiting the number of times the token can |
| 18 |
be used, you can inspect and manipulate the token in the |
| 19 |
``validate_client_registration()`` adapter hook. |