Added new user claim

added claim preferred_username for id token
and user endpoint reponse

Change-Id: Ie53e96120d617be667a79c263b299cd00f16901a
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
smarcet 2020-03-16 12:51:22 -03:00
parent 8d6f9a2fdb
commit b28d98aa4c
2 changed files with 2 additions and 1 deletions

View File

@ -176,6 +176,7 @@ final class UserService extends OAuth2ProtectedService implements IUserService
// Profile Claims
$claim_set->addClaim(new JWTClaim(StandardClaims::Name, new StringOrURI($user->getFullName())));
$claim_set->addClaim(new JWTClaim(StandardClaims::GivenName, new StringOrURI($user->getFirstName())));
$claim_set->addClaim(new JWTClaim(StandardClaims::PreferredUserName, new StringOrURI($user->getNickName())));
$claim_set->addClaim(new JWTClaim(StandardClaims::FamilyName, new StringOrURI($user->getLastName())));
$claim_set->addClaim(new JWTClaim(StandardClaims::NickName, new StringOrURI($user->getNickName())));
$claim_set->addClaim(new JWTClaim(StandardClaims::Picture, new StringOrURI($user->getPic())));

View File

@ -44,7 +44,7 @@ abstract class StandardClaims
const NickName = 'nickname';
/**
* string Shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe.
* string Shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe.
* This value MAY be any valid JSON string including special characters such as @, /, or whitespace. The RP MUST
* NOT rely upon this value being unique, as discussed in Section 5.7.
*/