Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
bbc7929
Client registration endpoint should return a 201 HTTP response code o…
rohe Aug 31, 2021
178ca74
Default token lifetime should not be 0 (zero). Changed to be 30 minut…
rohe Sep 1, 2021
ce142a8
Userinfo endpoint should support POST.
rohe Sep 2, 2021
6f87892
Authorization error response MUST contain 'state' if it is present in…
rohe Sep 2, 2021
32640c1
Authorization error response MUST contain 'state' if it is present in…
rohe Sep 2, 2021
a158741
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
e7303bc
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
f2b8ea2
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
0003078
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
fcfd63b
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
6659459
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
71c77b6
Cookie handling - bug, wrong name.
rohe Sep 2, 2021
5cfa289
parse_cookie twice.
rohe Sep 2, 2021
f384d20
parse_cookie twice.
rohe Sep 2, 2021
5146010
parse_cookie twice.
rohe Sep 2, 2021
c57bd80
parse_cookie twice.
rohe Sep 2, 2021
031cd28
parse_cookie twice.
rohe Sep 2, 2021
93e9589
More logging
rohe Sep 3, 2021
cc6337a
More logging
rohe Sep 3, 2021
bf595db
Too old authentication
rohe Sep 3, 2021
c0607d5
Too old authentication - logging
rohe Sep 3, 2021
bef128e
Too old authentication
rohe Sep 3, 2021
f7cc53a
Cookie info
rohe Sep 3, 2021
0ea0cea
Cookie info
rohe Sep 3, 2021
ff35728
Wrong error code.
rohe Sep 3, 2021
93eb7a7
Revoke tokens that has been minted using a code that then is used onc…
rohe Sep 3, 2021
fc59033
Undefined max age
rohe Sep 3, 2021
007fc0e
Correct user.
rohe Sep 3, 2021
9188cac
logging
rohe Sep 3, 2021
88da05a
logging
rohe Sep 3, 2021
5879a9a
Verify correct user
rohe Sep 3, 2021
f061a88
Verify correct user
rohe Sep 3, 2021
2c8b44c
prompt==login forces reauthentication.
rohe Sep 6, 2021
de49d67
prompt==login forces reauthentication.
rohe Sep 6, 2021
f0d2d8c
prompt==login forces reauthentication.
rohe Sep 6, 2021
4ee4b3f
prompt==login forces reauthentication.
rohe Sep 6, 2021
22e3b7d
prompt==login forces reauthentication.
rohe Sep 6, 2021
a61e27e
Prompt is a list.
rohe Sep 6, 2021
984eb5a
Prompt is a list.
rohe Sep 6, 2021
ba3b9d5
Add grant_types_supported per client
nsklikas Sep 6, 2021
675be13
Add docs
nsklikas Sep 6, 2021
d920971
Merge pull request #124 from nsklikas/feature-grant-types-per-client
peppelinux Sep 6, 2021
768dc30
Merge branch 'develop' into certification
rohe Sep 7, 2021
3abbb14
Fixed cookie_info().
rohe Sep 7, 2021
9a2f6cf
Merge pull request #125 from IdentityPython/certification
rohe Sep 16, 2021
f091c20
Refactor scopes
nsklikas Sep 13, 2021
fbd1c62
Add get_claims_from_request
nsklikas Sep 20, 2021
76623c0
Minor fixes
nsklikas Sep 20, 2021
fcb4890
Add allowed_scopes to README
nsklikas Sep 20, 2021
c0bb0ca
Don't issue refresh token if not configured
nsklikas Sep 9, 2021
5228f17
Fix tests
nsklikas Sep 10, 2021
8ce8389
Merge pull request #130 from nsklikas/feature-refactor-scopes
peppelinux Sep 20, 2021
1a9f458
Fix form post bug
nsklikas Sep 20, 2021
7099c2d
Merge pull request #131 from IdentityPython/fix-form-post
peppelinux Sep 21, 2021
9cb37c4
Catch unhandled exception
nsklikas Sep 21, 2021
946f20f
Rename advertised_scopes to scopes_supported
nsklikas Sep 21, 2021
ddb861b
Rename scopes_mapping to scopes_to_claims
nsklikas Sep 21, 2021
0d56f5e
Merge pull request #132 from nsklikas/fix-userinfo-invalid-token
rohe Sep 21, 2021
1f16205
Merge pull request #133 from nsklikas/fix-scopes-name
rohe Sep 21, 2021
9eb577b
Merge pull request #128 from nsklikas/feature-grant-types-fix
rohe Sep 23, 2021
16e99e6
Add parameter to revoke old refresh token upon issuing new
ctriant Sep 22, 2021
47120f8
Merge pull request #137 from ctriant/revoke_refresh_token_on_issue
peppelinux Oct 6, 2021
ed7e849
Add README
nsklikas Sep 9, 2021
8387e9d
Add more client configurations
nsklikas Oct 6, 2021
cdfa5e5
Use filter_scopes in check_unknown_scopes_policy
nsklikas Oct 6, 2021
82cb13a
Fix log
nsklikas Oct 6, 2021
49c6cec
Don't require a scope to be defined
nsklikas Sep 22, 2021
635dd24
Merge pull request #138 from nsklikas/feature-allowed-scope
peppelinux Oct 7, 2021
ad12a8b
Merge pull request #129 from nsklikas/feature-client-documentation
peppelinux Oct 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
350 changes: 287 additions & 63 deletions docs/source/contents/conf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,36 @@ Optional. Salt, value or filename, used in sub_funcs (pairwise, public) for crea
sub_funcs
#########

Optional. Functions involved in *sub*ject value creation.
Optional. Functions involved in subject value creation.


scopes_to_claims
################

A dict defining the scopes that are allowed to be used per client and the claims
they map to (defaults to the scopes mapping described in the spec). If we want
to define a scope that doesn't map to claims (e.g. offline_access) then we
simply map it to an empty list. E.g.::

{
"scope_a": ["claim1", "claim2"],
"scope_b": []
}

*Note*: For OIDC the `openid` scope must be present in this mapping.


allowed_scopes
##############

A list with the scopes that are allowed to be used (defaults to the keys in scopes_to_claims).


scopes_supported
################

A list with the scopes that will be advertised in the well-known endpoint (defaults to allowed_scopes).


------
add_on
Expand All @@ -67,21 +96,6 @@ An example::
"code_challenge_method": "S256 S384 S512"
}
},
"claims": {
"function": "oidcop.oidc.add_on.custom_scopes.add_custom_scopes",
"kwargs": {
"research_and_scholarship": [
"name",
"given_name",
"family_name",
"email",
"email_verified",
"sub",
"iss",
"eduperson_scoped_affiliation"
]
}
}
}

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

---------
client_db
Expand Down Expand Up @@ -325,8 +341,9 @@ An example::
"client_secret_post",
"client_secret_basic",
"client_secret_jwt",
"private_key_jwt"
]
"private_key_jwt",
],
"revoke_refresh_on_issue": True
}
},
"userinfo": {
Expand Down Expand Up @@ -649,57 +666,14 @@ the following::
Clients
=======

In this section there are some client configuration examples.

A common configuration::

endpoint_context.cdb['jbxedfmfyc'] = {
client_id: 'jbxedfmfyc',
client_salt: '6flfsj0Z',
registration_access_token: 'z3PCMmC1HZ1QmXeXGOQMJpWQNQynM4xY',
registration_client_uri: 'https://127.0.0.1:8000/registration_api?client_id=jbxedfmfyc',
client_id_issued_at: 1630256902,
client_secret: '19cc69b70d0108f630e52f72f7a3bd37ba4e11678ad1a7434e9818e1',
client_secret_expires_at: 1929727754,
application_type: 'web',
contacts: [
'rp@example.com'
],
token_endpoint_auth_method: 'client_secret_basic',
redirect_uris: [
[
'https://127.0.0.1:8090/authz_cb/satosa',
{}
]
],
post_logout_redirect_uris: [
[
'https://127.0.0.1:8090/session_logout/satosa',
null
]
],
response_types: [
'code'
],
grant_types: [
'authorization_code'
],
allowed_scopes: [
'openid',
'profile',
'email',
'offline_access'
]
}

In this section there are some client configuration examples. That can be used
to override the global configuration of the OP.

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

endpoint_context.cdb["client_1"] = {
"client_secret": "hemligt",
"redirect_uris": [("https://example.com/cb", None)],
"client_salt": "salted",
"token_endpoint_auth_method": "client_secret_post",
"response_types": ["code", "token", "code id_token", "id_token"],
"add_claims": {
"always": {
Expand All @@ -712,3 +686,253 @@ How to configure the release of the user claims per clients::
"id_token": False,
},
},

The available configuration options are:

-------------
client_secret
-------------

The client secret. This parameter is required.

------------------------
client_secret_expires_at
------------------------

When the client_secret expires.

-------------
redirect_uris
-------------

The client's redirect uris.

-----------
auth_method
-----------

The auth_method that can be used per endpoint.
E.g::

{
"AccessTokenRequest": "client_secret_basic",
...
}

------------
request_uris
------------

A list of `request_uris`.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata.

--------------
response_types
--------------

The allowed `response_types` for this client.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata.

---------------------
grant_types_supported
---------------------

Configure the allowed grant types on the token endpoint.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata.

----------------
scopes_to_claims
----------------

A dict defining the scopes that are allowed to be used per client and the claims
they map to (defaults to the scopes mapping described in the spec). If we want
to define a scope that doesn't map to claims (e.g. offline_access) then we
simply map it to an empty list. E.g.::

{
"scope_a": ["claim1", "claim2"],
"scope_b": []
}

--------------
allowed_scopes
--------------

A list with the scopes that are allowed to be used (defaults to the keys in the
clients scopes_to_claims).

-----------------------
revoke_refresh_on_issue
-----------------------

Configure whether to revoke the refresh token that was used to issue a new refresh token.

----------
add_claims
----------

A dictionary with the following keys

always
######

A dictionary with the following keys: `userinfo`, `id_token`, `introspection`, `access_token`.
The keys are used to describe the claims we want to add to the corresponding interface.
The keys can be a list of claims to be added or a dict in the format described
in https://openid.net/specs/openid-connect-core-1_0.html#IndividualClaimsRequests
E.g.::

{
"add_claims": {
"always": {
"userinfo": ["email", "phone"], # Always add "email" and "phone" in the userinfo response if such claims exists
"id_token": {"email": null}, # Always add "email" in the id_token if such a claim exists
"introspection": {"email": {"value": "a@a.com"}}, # Add "email" in the introspection response only if its value is "a@a.com"
}
}
}

by_scope
########

A dictionary with the following keys: `userinfo`, `id_token`, `introspection`, `access_token`.
The keys are boolean values that describe whether the scopes should be mapped
to claims and added to the response.
E.g.::

{
"add_claims": {
"by_scope": {
id_token: True, # Map the requested scopes to claims and add them to the id token
}

-----------------
token_usage_rules
-----------------

The usage rules for each token type. E.g.::

{
"usage_rules": {
"authorization_code": {
"expires_in": 3600,
"supports_minting": [
"access_token",
"id_token",
],
"max_usage": 1,
},
"access_token": {
"expires_in": self.params["access_token_lifetime"],
},
}
}

--------------
pkce_essential
--------------

Whether pkce is essential for this client.

------------------------
post_logout_redirect_uri
------------------------

The client's post logout redirect uris.

See https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout.

----------------------
backchannel_logout_uri
----------------------

The client's `backchannel_logout_uri`.

See https://openid.net/specs/openid-connect-backchannel-1_0.html#BCRegistration

-----------------------
frontchannel_logout_uri
-----------------------

The client's `frontchannel_logout_uri`.

See https://openid.net/specs/openid-connect-frontchannel-1_0.html#RPLogout

--------------------------
request_object_signing_alg
--------------------------

A list with the allowed algorithms for signing the request object.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

-----------------------------
request_object_encryption_alg
-----------------------------

A list with the allowed alg algorithms for encrypting the request object.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

-----------------------------
request_object_encryption_enc
-----------------------------

A list with the allowed enc algorithms for signing the request object.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

----------------------------
userinfo_signed_response_alg
----------------------------

JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

-------------------------------
userinfo_encrypted_response_enc
-------------------------------

The alg algorithm [JWA] REQUIRED for encrypting UserInfo Responses.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

-------------------------------
userinfo_encrypted_response_alg
-------------------------------

JWE enc algorithm [JWA] REQUIRED for encrypting UserInfo Responses.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

----------------------------
id_token_signed_response_alg
----------------------------

JWS alg algorithm [JWA] REQUIRED for signing ID Token issued to this Client.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

-------------------------------
id_token_encrypted_response_enc
-------------------------------

The alg algorithm [JWA] REQUIRED for encrypting ID Token issued to this Client.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

-------------------------------
id_token_encrypted_response_alg
-------------------------------

JWE enc algorithm [JWA] REQUIRED for encrypting ID Token issued to this Client.

See https://openid.net/specs/openid-connect-registration-1_0-29.html#ClientMetadata

--------
dpop_jkt
--------
Loading