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.StringgetClientId()java.lang.StringgetClientSecret()java.lang.StringgetGrantType()java.lang.StringgetPassword()java.lang.StringgetScope()java.lang.StringgetUsername()voidsetClientId(java.lang.String clientId)Sets the client id in the grant.voidsetClientSecret(java.lang.String clientSecret)Sets the client secret in the grant.voidsetGrantType(java.lang.String grantType)voidsetPassword(java.lang.String password)voidsetScope(java.lang.String scope)voidsetUsername(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:SecureGrantSets the client id in the grant.- Specified by:
setClientIdin interfaceSecureGrant- Parameters:
clientId- Application's Client identifier.
-
setClientSecret
public void setClientSecret(java.lang.String clientSecret)
Description copied from interface:SecureGrantSets the client secret in the grant.- Specified by:
setClientSecretin 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
-
-