Updated claims on OpenId/OAuth
* updated claim nickname to be user identifier * added sub claim to endpoint /api/v1/userinfo/me * fixed broken test Change-Id: I9c34e5c2271ba5bcf7e480ea31530d1717fb0e09
This commit is contained in:
parent
8bfc282634
commit
b459998364
@ -39,6 +39,7 @@ final class EloquentResourceServerRepository
|
||||
*/
|
||||
public function getByHost($host)
|
||||
{
|
||||
if(!is_array($host)) $host = [$host];
|
||||
return $this->entity->whereIn('host', $host)->first();
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,8 @@ class UserService extends OAuth2ProtectedService implements IUserService
|
||||
$data[StandardClaims::Name] = $current_user->getFullName();
|
||||
$data[StandardClaims::GivenName] = $current_user->getFirstName();
|
||||
$data[StandardClaims::FamilyName] = $current_user->getLastName();
|
||||
$data[StandardClaims::NickName] = $current_user->getNickName();
|
||||
$data[StandardClaims::NickName] = $current_user->getIdentifier();
|
||||
$data[StandardClaims::SubjectIdentifier] = $current_user->getAuthIdentifier();
|
||||
$data[StandardClaims::Picture] = $pic_url;
|
||||
$data[StandardClaims::Birthdate] = $current_user->getDateOfBirth();
|
||||
$data[StandardClaims::Gender] = $current_user->getGender();
|
||||
|
@ -152,6 +152,9 @@ class OpenIdSREGExtension_1_0 extends OpenIdExtension
|
||||
if ($attr == self::Nickname || $attr == self::FullName) {
|
||||
$response->addParam(self::param($attr), $user->getFullName());
|
||||
}
|
||||
if ($attr == self::Nickname) {
|
||||
$response->addParam(self::param($attr), $user->getIdentifier());
|
||||
}
|
||||
if ($attr == self::Language) {
|
||||
$response->addParam(self::param($attr), $user->getLanguage());
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ class OpenIdProtocolTest extends OpenStackIDBaseTest
|
||||
|
||||
//set login info
|
||||
Session::set("openid.authorization.response", IAuthService::AuthorizationResponse_AllowForever);
|
||||
$sreg_required_params = array('email', 'fullname');
|
||||
$sreg_required_params = array('email', 'fullname', 'nickname');
|
||||
|
||||
$params = array(
|
||||
OpenIdProtocol::param(OpenIdProtocol::OpenIDProtocol_NS) => OpenIdProtocol::OpenID2MessageType,
|
||||
|
Loading…
x
Reference in New Issue
Block a user