Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit a87177e

Browse files
authored
Merge pull request #139 from IdentityPython/develop
v2.2.0
2 parents 66eb57b + ad12a8b commit a87177e

32 files changed

+1452
-422
lines changed

docs/source/contents/conf.rst

Lines changed: 287 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,36 @@ Optional. Salt, value or filename, used in sub_funcs (pairwise, public) for crea
5151
sub_funcs
5252
#########
5353

54-
Optional. Functions involved in *sub*ject value creation.
54+
Optional. Functions involved in subject value creation.
55+
56+
57+
scopes_to_claims
58+
################
59+
60+
A dict defining the scopes that are allowed to be used per client and the claims
61+
they map to (defaults to the scopes mapping described in the spec). If we want
62+
to define a scope that doesn't map to claims (e.g. offline_access) then we
63+
simply map it to an empty list. E.g.::
64+
65+
{
66+
"scope_a": ["claim1", "claim2"],
67+
"scope_b": []
68+
}
69+
70+
*Note*: For OIDC the `openid` scope must be present in this mapping.
71+
72+
73+
allowed_scopes
74+
##############
75+
76+
A list with the scopes that are allowed to be used (defaults to the keys in scopes_to_claims).
77+
78+
79+
scopes_supported
80+
################
81+
82+
A list with the scopes that will be advertised in the well-known endpoint (defaults to allowed_scopes).
83+
5584

5685
------
5786
add_on
@@ -67,21 +96,6 @@ An example::
6796
"code_challenge_method": "S256 S384 S512"
6897
}
6998
},
70-
"claims": {
71-
"function": "oidcop.oidc.add_on.custom_scopes.add_custom_scopes",
72-
"kwargs": {
73-
"research_and_scholarship": [
74-
"name",
75-
"given_name",
76-
"family_name",
77-
"email",
78-
"email_verified",
79-
"sub",
80-
"iss",
81-
"eduperson_scoped_affiliation"
82-
]
83-
}
84-
}
8599
}
86100

87101
The provided add-ons can be seen in the following sections.
@@ -176,6 +190,8 @@ An example::
176190
backchannel_logout_supported: True
177191
backchannel_logout_session_supported: True
178192
check_session_iframe: https://127.0.0.1:5000/check_session_iframe
193+
scopes_supported: ["openid", "profile", "random"]
194+
claims_supported: ["sub", "given_name", "birthdate"]
179195

180196
---------
181197
client_db
@@ -325,8 +341,9 @@ An example::
325341
"client_secret_post",
326342
"client_secret_basic",
327343
"client_secret_jwt",
328-
"private_key_jwt"
329-
]
344+
"private_key_jwt",
345+
],
346+
"revoke_refresh_on_issue": True
330347
}
331348
},
332349
"userinfo": {
@@ -649,57 +666,14 @@ the following::
649666
Clients
650667
=======
651668

652-
In this section there are some client configuration examples.
653-
654-
A common configuration::
655-
656-
endpoint_context.cdb['jbxedfmfyc'] = {
657-
client_id: 'jbxedfmfyc',
658-
client_salt: '6flfsj0Z',
659-
registration_access_token: 'z3PCMmC1HZ1QmXeXGOQMJpWQNQynM4xY',
660-
registration_client_uri: 'https://127.0.0.1:8000/registration_api?client_id=jbxedfmfyc',
661-
client_id_issued_at: 1630256902,
662-
client_secret: '19cc69b70d0108f630e52f72f7a3bd37ba4e11678ad1a7434e9818e1',
663-
client_secret_expires_at: 1929727754,
664-
application_type: 'web',
665-
contacts: [
666-
'rp@example.com'
667-
],
668-
token_endpoint_auth_method: 'client_secret_basic',
669-
redirect_uris: [
670-
[
671-
'https://127.0.0.1:8090/authz_cb/satosa',
672-
{}
673-
]
674-
],
675-
post_logout_redirect_uris: [
676-
[
677-
'https://127.0.0.1:8090/session_logout/satosa',
678-
null
679-
]
680-
],
681-
response_types: [
682-
'code'
683-
],
684-
grant_types: [
685-
'authorization_code'
686-
],
687-
allowed_scopes: [
688-
'openid',
689-
'profile',
690-
'email',
691-
'offline_access'
692-
]
693-
}
694-
669+
In this section there are some client configuration examples. That can be used
670+
to override the global configuration of the OP.
695671

696672
How to configure the release of the user claims per clients::
697673

698674
endpoint_context.cdb["client_1"] = {
699675
"client_secret": "hemligt",
700676
"redirect_uris": [("https://example.com/cb", None)],
701-
"client_salt": "salted",
702-
"token_endpoint_auth_method": "client_secret_post",
703677
"response_types": ["code", "token", "code id_token", "id_token"],
704678
"add_claims": {
705679
"always": {
@@ -712,3 +686,253 @@ How to configure the release of the user claims per clients::
712686
"id_token": False,
713687
},
714688
},
689+
690+
The available configuration options are:
691+
692+
-------------
693+
client_secret
694+
-------------
695+
696+
The client secret. This parameter is required.
697+
698+
------------------------
699+
client_secret_expires_at
700+
------------------------
701+
702+
When the client_secret expires.
703+
704+
-------------
705+
redirect_uris
706+
-------------
707+
708+
The client's redirect uris.
709+
710+
-----------
711+
auth_method
712+
-----------
713+
714+
The auth_method that can be used per endpoint.
715+
E.g::
716+
717+
{
718+
"AccessTokenRequest": "client_secret_basic",
719+
...
720+
}
721+
722+
------------
723+
request_uris
724+
------------
725+
726+
A list of `request_uris`.
727+
728+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata.
729+
730+
--------------
731+
response_types
732+
--------------
733+
734+
The allowed `response_types` for this client.
735+
736+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata.
737+
738+
---------------------
739+
grant_types_supported
740+
---------------------
741+
742+
Configure the allowed grant types on the token endpoint.
743+
744+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata.
745+
746+
----------------
747+
scopes_to_claims
748+
----------------
749+
750+
A dict defining the scopes that are allowed to be used per client and the claims
751+
they map to (defaults to the scopes mapping described in the spec). If we want
752+
to define a scope that doesn't map to claims (e.g. offline_access) then we
753+
simply map it to an empty list. E.g.::
754+
755+
{
756+
"scope_a": ["claim1", "claim2"],
757+
"scope_b": []
758+
}
759+
760+
--------------
761+
allowed_scopes
762+
--------------
763+
764+
A list with the scopes that are allowed to be used (defaults to the keys in the
765+
clients scopes_to_claims).
766+
767+
-----------------------
768+
revoke_refresh_on_issue
769+
-----------------------
770+
771+
Configure whether to revoke the refresh token that was used to issue a new refresh token.
772+
773+
----------
774+
add_claims
775+
----------
776+
777+
A dictionary with the following keys
778+
779+
always
780+
######
781+
782+
A dictionary with the following keys: `userinfo`, `id_token`, `introspection`, `access_token`.
783+
The keys are used to describe the claims we want to add to the corresponding interface.
784+
The keys can be a list of claims to be added or a dict in the format described
785+
in https://openid.net/specs/openid-connect-core-1_0.html#IndividualClaimsRequests
786+
E.g.::
787+
788+
{
789+
"add_claims": {
790+
"always": {
791+
"userinfo": ["email", "phone"], # Always add "email" and "phone" in the userinfo response if such claims exists
792+
"id_token": {"email": null}, # Always add "email" in the id_token if such a claim exists
793+
"introspection": {"email": {"value": "a@a.com"}}, # Add "email" in the introspection response only if its value is "a@a.com"
794+
}
795+
}
796+
}
797+
798+
by_scope
799+
########
800+
801+
A dictionary with the following keys: `userinfo`, `id_token`, `introspection`, `access_token`.
802+
The keys are boolean values that describe whether the scopes should be mapped
803+
to claims and added to the response.
804+
E.g.::
805+
806+
{
807+
"add_claims": {
808+
"by_scope": {
809+
id_token: True, # Map the requested scopes to claims and add them to the id token
810+
}
811+
812+
-----------------
813+
token_usage_rules
814+
-----------------
815+
816+
The usage rules for each token type. E.g.::
817+
818+
{
819+
"usage_rules": {
820+
"authorization_code": {
821+
"expires_in": 3600,
822+
"supports_minting": [
823+
"access_token",
824+
"id_token",
825+
],
826+
"max_usage": 1,
827+
},
828+
"access_token": {
829+
"expires_in": self.params["access_token_lifetime"],
830+
},
831+
}
832+
}
833+
834+
--------------
835+
pkce_essential
836+
--------------
837+
838+
Whether pkce is essential for this client.
839+
840+
------------------------
841+
post_logout_redirect_uri
842+
------------------------
843+
844+
The client's post logout redirect uris.
845+
846+
See https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout.
847+
848+
----------------------
849+
backchannel_logout_uri
850+
----------------------
851+
852+
The client's `backchannel_logout_uri`.
853+
854+
See https://openid.net/specs/openid-connect-backchannel-1_0.html#BCRegistration
855+
856+
-----------------------
857+
frontchannel_logout_uri
858+
-----------------------
859+
860+
The client's `frontchannel_logout_uri`.
861+
862+
See https://openid.net/specs/openid-connect-frontchannel-1_0.html#RPLogout
863+
864+
--------------------------
865+
request_object_signing_alg
866+
--------------------------
867+
868+
A list with the allowed algorithms for signing the request object.
869+
870+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
871+
872+
-----------------------------
873+
request_object_encryption_alg
874+
-----------------------------
875+
876+
A list with the allowed alg algorithms for encrypting the request object.
877+
878+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
879+
880+
-----------------------------
881+
request_object_encryption_enc
882+
-----------------------------
883+
884+
A list with the allowed enc algorithms for signing the request object.
885+
886+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
887+
888+
----------------------------
889+
userinfo_signed_response_alg
890+
----------------------------
891+
892+
JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses.
893+
894+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
895+
896+
-------------------------------
897+
userinfo_encrypted_response_enc
898+
-------------------------------
899+
900+
The alg algorithm [JWA] REQUIRED for encrypting UserInfo Responses.
901+
902+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
903+
904+
-------------------------------
905+
userinfo_encrypted_response_alg
906+
-------------------------------
907+
908+
JWE enc algorithm [JWA] REQUIRED for encrypting UserInfo Responses.
909+
910+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
911+
912+
----------------------------
913+
id_token_signed_response_alg
914+
----------------------------
915+
916+
JWS alg algorithm [JWA] REQUIRED for signing ID Token issued to this Client.
917+
918+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
919+
920+
-------------------------------
921+
id_token_encrypted_response_enc
922+
-------------------------------
923+
924+
The alg algorithm [JWA] REQUIRED for encrypting ID Token issued to this Client.
925+
926+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
927+
928+
-------------------------------
929+
id_token_encrypted_response_alg
930+
-------------------------------
931+
932+
JWE enc algorithm [JWA] REQUIRED for encrypting ID Token issued to this Client.
933+
934+
See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata
935+
936+
--------
937+
dpop_jkt
938+
--------

0 commit comments

Comments
 (0)