Class PasswordGrant
- java.lang.Object
-
- io.micronaut.security.oauth2.grants.PasswordGrant
-
- All Implemented Interfaces:
AsMap
,SecureGrant
@Introspected public class PasswordGrant extends java.lang.Object implements SecureGrant, AsMap
Resource Owner Password Credentials Grant.- Since:
- 1.2.0
- Author:
- Sergio del Amo
- See Also:
- Access Token Request
-
-
Constructor Summary
Constructors Constructor Description PasswordGrant()
Default constructor.PasswordGrant(AuthenticationRequest authenticationRequest, OauthClientConfiguration clientConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClientId()
java.lang.String
getClientSecret()
java.lang.String
getGrantType()
java.lang.String
getPassword()
java.lang.String
getScope()
java.lang.String
getUsername()
void
setClientId(java.lang.String clientId)
Sets the client id in the grant.void
setClientSecret(java.lang.String clientSecret)
Sets the client secret in the grant.void
setGrantType(java.lang.String grantType)
void
setPassword(java.lang.String password)
void
setScope(java.lang.String scope)
void
setUsername(java.lang.String username)
java.util.Map<java.lang.String,java.lang.String>
toMap()
-
-
-
Constructor Detail
-
PasswordGrant
public PasswordGrant()
Default constructor.
-
PasswordGrant
public PasswordGrant(AuthenticationRequest authenticationRequest, OauthClientConfiguration clientConfiguration)
- Parameters:
authenticationRequest
- The authentication requestclientConfiguration
- The client configuration
-
-
Method Detail
-
getGrantType
@Nonnull public java.lang.String getGrantType()
- Returns:
- OAuth 2.0 Grant Type.
-
setGrantType
public void setGrantType(@Nonnull java.lang.String grantType)
- Parameters:
grantType
- OAuth 2.0 Grant Type.
-
getClientId
@Nonnull public java.lang.String getClientId()
- Returns:
- The application's Client identifier.
-
setClientId
public void setClientId(@Nonnull java.lang.String clientId)
Description copied from interface:SecureGrant
Sets the client id in the grant.- Specified by:
setClientId
in interfaceSecureGrant
- Parameters:
clientId
- Application's Client identifier.
-
setClientSecret
public void setClientSecret(java.lang.String clientSecret)
Description copied from interface:SecureGrant
Sets the client secret in the grant.- Specified by:
setClientSecret
in interfaceSecureGrant
- Parameters:
clientSecret
- Application's Client clientSecret.
-
getClientSecret
public java.lang.String getClientSecret()
- Returns:
- The application's Client clientSecret.
-
getUsername
@Nonnull public java.lang.String getUsername()
- Returns:
- An username
-
setUsername
public void setUsername(@Nonnull java.lang.String username)
- Parameters:
username
- An username
-
getPassword
@Nonnull public java.lang.String getPassword()
- Returns:
- An password
-
setPassword
public void setPassword(@Nonnull java.lang.String password)
- Parameters:
password
- An password
-
getScope
@Nullable public java.lang.String getScope()
- Returns:
- Requested scopes separed by spaces
-
setScope
public void setScope(@Nonnull java.lang.String scope)
- Parameters:
scope
- Requested scopes separed by spaces
-
-