-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add OpenID Response Type #1316
base: master
Are you sure you want to change the base?
Add OpenID Response Type #1316
Conversation
Apply fixes from StyleCI
Apply fixes from StyleCI
This reverts commit 35af257.
Apply fixes from StyleCI
Apply fixes from StyleCI
I'm glad to see some progress here! @marcriemer do you intend to continue working on it? Did you get stuck somewhere particularly? |
@doobry-systemli So far my implementation works very well. I will continue my work on in this feature. Please let me know If you have any successions for improvements. |
Apply fixes from StyleCI
Version 9 bringing in the device code is being worked on just now. Then I will start to look at other features. V9 RC1 should be tagged today all being well |
@pat0s Thanks for bringing this up. You are right, the method should return a ClaimSetEntryInterface. The ClaimSetEntryInterface extends ClaimSetInterface. |
Apply fixes from StyleCI
Revert "Apply fixes from StyleCI"
Apply fixes from StyleCI
Apply fixes from StyleCI
Hi @marcriemer, Thanks for the initiative and your work. It's a very interesting feature. @Sephster Have you any news about this PR ? |
$builder = $this->idTokenRepository->getBuilder($accessToken); | ||
|
||
if ($claimSet instanceof ClaimSetEntryInterface) { | ||
foreach ($this->extractor->extract($accessToken->getScopes(), $claimSet->getClaims()) as $claimName => $claimValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getClaims
is documented as returning string[]
while the extractor expects array<string, string>
. This looks inconsistent to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, this looks like we need 2 separate interface: one returning the map of claim names to claim values (used by the ClaimRepository when getting the claims for an access token) and one listing a set of claim names associated with a scope.
Even if both interfaces have a method named getClaims
, the would still be separate interface due to different signatures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, rebasing this PR would probably make the CI red because phpstan should be complaining about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the ClaimExtractor needs to be fixed. It extracts ClaimSetEntryInterface, therefore most vars and properties are completely off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation of a ClaimSetInterface
used by the ClaimExtractor
could look like this:
/**
* Get users claims
*
* @return array<string, string>
*/
public function getClaims(): array
{
return [
'preferred_username' => $this->getUsername(),
'email' => $this->getEmail(),
];
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but ClaimSetEntryInterface currently extends ClaimSet. this is what looks wrong to me as it seems like a separate concern (on one side, we associate a scope with a set of claim names, and on the other side, we have a map of claim names to claim values, which is not a set at all but a map)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ClaimExtractor was confusing: marcriemer@b1400a1
@marcriemer @Sephster what is the status of this work ? |
->expiresAt($accessToken->getExpiryDateTime()) | ||
->relatedTo($accessToken->getUserIdentifier()); | ||
|
||
if ($this->nonce) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the nonce come from the authorization request ? Configuring as a constructor argument of the repository is probably not usable. It would be great to have an actual example of the openid setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, the example is far from being perfect. The nonce must be part of the AuthCodeEntityInterface and used by ClaimSetRepositoryInterface to create ClaimSetInterface with the nonce claim.
@stof I would love to contribute more, but some commits are sitting on the sideline right now. My complete OIDC implementation is nearly finished, including ImplicitOpenidGrant, AuthCodeOpenidGrant, and AbstractAuthorizeGrant along with all the related response types. However, it will require significant changes to this project. @Sephster It may make sense to create a LTS branch and move faster forward for those who require new features. Authentication is changing fast right now. We need to keep up. |
Apply fixes from StyleCI
Apply fixes from StyleCI
No description provided.