Class UserInfoService


  • public class UserInfoService
    extends Object
    Service for retrieving user's information from the access token the user granted the authorization.
    Since:
    12.0.0
    • Constructor Detail

      • UserInfoService

        @Inject
        public UserInfoService​(TokenStore tokenStore,
                               OAuth2ProviderSettingsFactory providerSettingsFactory,
                               @Named("header")
                               AccessTokenVerifier headerTokenVerifier,
                               @Named("form-body")
                               AccessTokenVerifier formTokenVerifier,
                               ClientRegistrationStore clientRegistrationStore)
        Constructs a new UserInfoServiceImpl.
        Parameters:
        tokenStore - An instance of the TokenStore.
        providerSettingsFactory - An instance of the OAuth2ProviderSettingsFactory.
        headerTokenVerifier - An instance of the AccessTokenVerifier to validate Authorization header.
        formTokenVerifier - An instance of the AccessTokenVerifier to validate form body.
        clientRegistrationStore - An instance of the client registration store.
    • Method Detail

      • getUserInfo

        public org.forgerock.json.JsonValue getUserInfo​(OAuth2Request request)
                                                 throws OAuth2Exception
        Gets the user's information for the specified access token.
        Parameters:
        request - The OAuth2 request.
        Returns:
        A JsonValue of the user's information.
        Throws:
        OAuth2Exception - If there is any issue in getting the user information.