-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ID Token does not contain user claims #449
Comments
After some tests, it seems that claims are included in the ID token only in some cases... When the authorize request set |
This definitely sounds like a bug, thanks for filing the issue and I will investigate further. |
If it can help... if ($this->config['use_openid_connect']) {
return new OpenIDAuthorizeController($this->storages['client'], $this->responseTypes, $config, $this->getScopeUtil());
} by : if ($this->config['use_openid_connect']) {
return new OpenIDAuthorizeController($this->storages['client'],$this->storages['public_key'], $this->responseTypes, $config, $this->getScopeUtil());
} I've implemented a extend constructor in And then, I've changed the if ($this->needsIdToken($this->getScope()) && $this->getResponseType() == self::RESPONSE_TYPE_AUTHORIZATION_CODE) {
$params['id_token'] = $this->responseTypes['id_token']->createIdToken($this->getClientId(), $user_id, $this->nonce);
} with : if ($this->needsIdToken($this->getScope()) && $this->getResponseType() == self::RESPONSE_TYPE_AUTHORIZATION_CODE) {
$userClaims = $this->publicKeyStorage->getUserClaims($user_id, $params['scope']);
$params['id_token'] = $this->responseTypes['id_token']->createIdToken($this->getClientId(), $user_id, $this->nonce, $userClaims);
} |
This helps tremendously. Thank you. |
This was intentional. If a response type results in an access token being returned, the application can get fresher user information by using the access token to ping an endpoint. |
if I understand correctly, the |
@mael-lg Could you provide your snippet of extending the constructor for |
I wanted to chime in here and give a better solution. The class In the with
That will return the claims as with the ID Token as expected. Hope this helps. |
When an ID Token is created from
OAuth2\OpenID\Controller\AuthorizeController
, thebuildAuthorizeParameters
function generate an ID Token wich does not include user claims.Is this behavior normal?
The text was updated successfully, but these errors were encountered: