Include extra keys in oidcGenerateUserInfoResponse (#2725)
This commit is contained in:
parent
569f38fc92
commit
6e7fd58113
|
@ -100,6 +100,7 @@ Sample code::
|
|||
|
||||
sub addClaimToUserInfo {
|
||||
my ( $self, $req, $userinfo, $rp, $session_data) = @_;
|
||||
my $scope = $session_data->{_scope};
|
||||
$userinfo->{"userinfo_hook"} = 1;
|
||||
return PE_OK;
|
||||
}
|
||||
|
|
|
@ -1832,7 +1832,7 @@ sub buildUserInfoResponseFromData {
|
|||
}
|
||||
|
||||
my $h = $self->p->processHook( $req, 'oidcGenerateUserInfoResponse',
|
||||
$userinfo_response, $rp, $session_data );
|
||||
$userinfo_response, $rp, $data );
|
||||
return {} if ( $h != PE_OK );
|
||||
|
||||
return $userinfo_response;
|
||||
|
|
|
@ -135,6 +135,7 @@ $res = $op->_post(
|
|||
$json = expectJSON($res);
|
||||
is( $json->{userinfo_hook}, 1, "Found hooked claim in Userinfo token" );
|
||||
is( $json->{_auth}, "Demo", "Found session variable in Userinfo token" );
|
||||
like( $json->{_scope}, qr/\bopenid\b/, "Scopes are visible in hook" );
|
||||
|
||||
expectJWT( $token, access_token_hook => 1 );
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ sub addClaimToUserInfo {
|
|||
my ( $self, $req, $userinfo, $rp, $session_data ) = @_;
|
||||
$userinfo->{"userinfo_hook"} = 1;
|
||||
$userinfo->{"_auth"} = $session_data->{_auth};
|
||||
$userinfo->{"_scope"} = $session_data->{_scope};
|
||||
return PE_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue