@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(String username,
Secret password)
Creates a new resource owner password credentials grant.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Secret |
getPassword()
Gets the resource owner's password.
|
String |
getUsername()
Gets the resource owner's username.
|
int |
hashCode() |
static ResourceOwnerPasswordCredentialsGrant |
parse(Map<String,String> params)
Parses a resource owner password credentials grant from the
specified parameters.
|
Map<String,String> |
toParameters()
Return the parameters for the authorisation grant.
|
getTypepublic static final GrantType GRANT_TYPE
public ResourceOwnerPasswordCredentialsGrant(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 String getUsername()
public Secret getPassword()
public Map<String,String> toParameters()
AuthorizationGranttoParameters in class AuthorizationGrantpublic static ResourceOwnerPasswordCredentialsGrant parse(Map<String,String> params) throws ParseException
Example:
grant_type=password username=johndoe password=A3ddj3w
params - The parameters.ParseException - If parsing failed.Copyright © 2017 Connect2id Ltd.. All rights reserved.