-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added authenticated dynamic client registration (#123)
Identity Providers support two ways how new clients can be registered through Dyncamic Client Registration: * Authenticated requests - Request to register new client must contain either Initial Access Token or Bearer Token. * Anonymous requests - Request to register new client doesn’t need to contain any token at all. Also adds support for custom redirect_uris and post_logout_redirect_uris for dynamic client registration through ClientRegistrationInfo class.
- Loading branch information
Showing
9 changed files
with
326 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,31 @@ To dynamically register a new client for your application, the required client r | |
```python | ||
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientRegistrationInfo | ||
|
||
client_registration_info = ClientRegistrationInfo(client_name='Test App', contacts=['[email protected]']) | ||
client_registration_info = ClientRegistrationInfo(client_name='Test App', contacts=['[email protected]'], | ||
redirect_uris=['https://client.example.com/redirect', | ||
'https://client.example.com/redirect2'], | ||
post_logout_redirect_uris=['https://client.example.com/logout', | ||
'https://client.example.com/logout2] | ||
registration_token='initial_access_token') | ||
provider_config = ProviderConfiguration(client_registration_info=client_registration_info, [provider_configuration]) | ||
``` | ||
|
||
**Note: To register all `redirect_uris` and `post_logout_redirect_uris` with the provider, | ||
you must provide them as a list in their respective keyword arguments.** | ||
|
||
Identity Providers support two ways how new clients can be registered through Dynamic Client Registration: | ||
|
||
1. Authenticated requests - the registration request must contain an "initial access token" obtained from your | ||
identity provider. | ||
If you want to use this method then you must provide `registration_token` keyword argument to `ClientRegistrationInfo`. | ||
|
||
2. Anonymous requests - the registration request doesn't need to contain any token. | ||
|
||
You can set any Client Metadata parameters for `ClientRegistrationInfo` during the registration. For a complete list of | ||
keyword arguments, see [Client Metadata](https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata). | ||
Also refer to the | ||
[Client Registration Request example](https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest). | ||
|
||
## Provider configuration | ||
|
||
### Dynamic provider configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.