Skip to content

Commit 8f59c77

Browse files
committed
Add note about custom claims and scopes
1 parent c3b3a45 commit 8f59c77

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎config/module_oidc.php.dist‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ $config = [
8080

8181
// The default translate table from SAML attributes to OIDC claims. If you don't want to support specific default
8282
// claim, set it to an empty array.
83+
//
84+
// Note: Standard claims are automatically associated with standard scopes (e.g. 'profile', 'email').
85+
// If you define custom (non-standard) claims here, you must also assign them to a custom scope
86+
// in `ModuleConfig::OPTION_AUTH_CUSTOM_SCOPES`, enable that scope for the client, and have the client
87+
// request it in order to expose them in the UserInfo endpoint or ID token.
8388
ModuleConfig::OPTION_AUTH_SAML_TO_OIDC_TRANSLATE_TABLE => [
8489
/*
8590
* The basic format is
@@ -177,7 +182,9 @@ $config = [
177182
// 'attributes' => [],
178183
// ],
179184
/*
180-
* Optional scopes attributes
185+
* Custom / non-standard claims.
186+
* To expose these claims, assign them to a custom scope in `OPTION_AUTH_CUSTOM_SCOPES` below,
187+
* enable that scope on the client, and request it in the authorization request.
181188
*/
182189
// 'national_document_id' => [
183190
// 'schacPersonalUniqueId',

‎docs/3-oidc-configuration.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ $config = [
119119
'description' => 'private scope',
120120
'claim_name_prefix' => '',
121121
'are_multiple_claim_values_allowed' => false,
122-
'attributes' => ['national_document_id'],
122+
'claims' => ['national_document_id'],
123123
],
124124
],
125125
];
@@ -155,6 +155,10 @@ $config = [
155155
];
156156
```
157157

158+
To expose newly created or custom claims in the UserInfo endpoint or ID token,
159+
they must also be assigned to a custom scope in `OPTION_AUTH_CUSTOM_SCOPES`,
160+
enabled for the client, and requested by the client.
161+
158162
## Auth Proc filters (OIDC)
159163

160164
Standard SAML Auth Proc Filters do not run during OIDC authN because not

0 commit comments

Comments
 (0)