Class PasswordGrant

java.lang.Object
io.micronaut.security.oauth2.grants.AbstractClientSecureGrant
io.micronaut.security.oauth2.grants.PasswordGrant
All Implemented Interfaces:
AsMap, SecureGrant

@Introspected public class PasswordGrant extends AbstractClientSecureGrant implements SecureGrant, AsMap
Resource Owner Password Credentials Grant.
Since:
1.2.0
Author:
Sergio del Amo
See Also:
  • Constructor Details

    • PasswordGrant

      public PasswordGrant(AuthenticationRequest authenticationRequest, OauthClientConfiguration clientConfiguration)
      Parameters:
      authenticationRequest - The authentication request
      clientConfiguration - The client configuration
  • Method Details

    • getGrantType

      @NonNull public @NonNull String getGrantType()
      Specified by:
      getGrantType in class AbstractClientSecureGrant
      Returns:
      OAuth 2.0 Grant Type.
    • setGrantType

      public void setGrantType(@NonNull @NonNull String grantType)
      Specified by:
      setGrantType in class AbstractClientSecureGrant
      Parameters:
      grantType - OAuth 2.0 Grant Type.
    • getUsername

      @NonNull public @NonNull String getUsername()
      Returns:
      An username
    • setUsername

      public void setUsername(@NonNull @NonNull String username)
      Parameters:
      username - An username
    • getPassword

      @NonNull public @NonNull String getPassword()
      Returns:
      An password
    • setPassword

      public void setPassword(@NonNull @NonNull String password)
      Parameters:
      password - An password
    • getScope

      @Nullable public @Nullable String getScope()
      Returns:
      Requested scopes separed by spaces
    • setScope

      public void setScope(@NonNull @NonNull String scope)
      Parameters:
      scope - Requested scopes separed by spaces
    • toMap

      @NonNull public @NonNull Map<String,String> toMap()
      Specified by:
      toMap in interface AsMap
      Overrides:
      toMap in class AbstractClientSecureGrant
      Returns:
      this object as a Map