oauth2-openid-connect-server
oauth2-openid-connect-server copied to clipboard
The ClaimSetInterface API is unclear
The interface ClaimSetInterface defines a getClaims(): array method without defining the expected type for the array.
This interface is used in 2 places:
- the
ClaimSetEntityclass implements it (alongside a confusingScopeInterfacewhich is not about representing a scope but a class with agetScopemethod) and seems to expectlist<string>as the type of the array based on the usages in ClaimExtractor - the
IdentityProviderInterfaceis expected to return aUserEntityInterfaceimplementing it. The IdTokenResponse then expectsgetClaimsto returnarray<string, string>based on the usage in the second argument ofClaimExtractorInterface
I think we should have 2 different interfaces there, one representing the claims available as a user (being a map from claim names to claim values) and another one representing a set of claim names associated with a scope.
@steverhoades do you have any insight on this ? Is my analysis of the expected types correct ? And what should be done about that ?