@Immutable public class ResourceOwnerPasswordCredentialsGrant extends AuthorizationGrant
Related specifications:
Modifier and Type | Field and Description |
---|---|
static GrantType |
GRANT_TYPE
The grant type.
|
Constructor and Description |
---|
ResourceOwnerPasswordCredentialsGrant(java.lang.String username,
Secret password)
Creates a new resource owner password credentials grant.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Secret |
getPassword()
Gets the resource owner's password.
|
java.lang.String |
getUsername()
Gets the resource owner's username.
|
int |
hashCode() |
static ResourceOwnerPasswordCredentialsGrant |
parse(java.util.Map<java.lang.String,java.lang.String> params)
Parses a resource owner password credentials grant from the
specified parameters.
|
java.util.Map<java.lang.String,java.lang.String> |
toParameters()
Return the parameters for the authorisation grant.
|
getType
public static final GrantType GRANT_TYPE
public ResourceOwnerPasswordCredentialsGrant(java.lang.String username, Secret password)
username
- The resource owner's username. Must not be
null
.password
- The resource owner's password. Must not be
null
.public java.lang.String getUsername()
public Secret getPassword()
public java.util.Map<java.lang.String,java.lang.String> toParameters()
AuthorizationGrant
toParameters
in class AuthorizationGrant
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static ResourceOwnerPasswordCredentialsGrant parse(java.util.Map<java.lang.String,java.lang.String> params) throws ParseException
Example:
grant_type=password username=johndoe password=A3ddj3w
params
- The parameters.ParseException
- If parsing failed.Copyright © 2016 Connect2id Ltd.. All Rights Reserved.