Class ResourceOwnerPasswordGrantTypeHandler


  • public class ResourceOwnerPasswordGrantTypeHandler
    extends GrantTypeHandler
    A grant type handler that can obtain an access token using the Resource Owner Password Credentials (ROPC) grant. While this grant type should generally not be used for users, it can be quite useful for use with service accounts.
    • Constructor Detail

      • ResourceOwnerPasswordGrantTypeHandler

        public ResourceOwnerPasswordGrantTypeHandler​(String clientId,
                                                     String username,
                                                     SecretReference<GenericSecret> password,
                                                     Collection<String> scope)
        Initialises the grant type handler with the given credentials.
        Parameters:
        clientId - the client id of the client requesting an access token.
        username - the username of the resource owner.
        password - a SecretReference to retrieve the password for the resource owner.
        scope - the scope of the request. May be null to request default scopes for this client.
      • ResourceOwnerPasswordGrantTypeHandler

        public ResourceOwnerPasswordGrantTypeHandler​(String clientId,
                                                     String username,
                                                     SecretReference<GenericSecret> password)
        Initialises the grant type handler with the given credentials and the default scope for this client.
        Parameters:
        clientId - the client id of the client requesting an access token.
        username - the username of the resource owner.
        password - a SecretReference to retrieve the password for the resource owner.