@Immutable public class PasswordGrantAuthorization extends SubjectAuthorization
PasswordGrantHandler. Specifies a
subject (end-user) and permits ID and refresh token issue.
Required authorisation details:
All other parameters are optional or have suitable defaults.
| Constructor and Description |
|---|
PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject,
Date authTime,
com.nimbusds.openid.connect.sdk.claims.ACR acr,
List<com.nimbusds.openid.connect.sdk.claims.AMR> amrList,
com.nimbusds.oauth2.sdk.Scope scope,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
boolean longLived,
AccessTokenSpec accessTokenSpec,
RefreshTokenSpec refreshTokenSpec,
IDTokenSpec idTokenSpec,
ClaimsSpec claimsSpec,
net.minidev.json.JSONObject data)
Creates a new OpenID Connect / OAuth 2.0 authorisation for a
password grant.
|
PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject,
com.nimbusds.oauth2.sdk.Scope scope)
Creates a new OAuth 2.0 - only authorisation for a password grant.
|
PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject,
com.nimbusds.oauth2.sdk.Scope scope,
boolean longLived,
AccessTokenSpec accessTokenSpec,
RefreshTokenSpec refreshTokenSpec,
IDTokenSpec idTokenSpec,
ClaimsSpec claimsSpec,
net.minidev.json.JSONObject data)
Creates a new OpenID Connect / OAuth 2.0 authorisation for a
password grant.
|
PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject,
com.nimbusds.oauth2.sdk.Scope scope,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
boolean longLived,
AccessTokenSpec accessTokenSpec,
RefreshTokenSpec refreshTokenSpec,
net.minidev.json.JSONObject data)
Creates a new OAuth 2.0 - only authorisation for a password grant.
|
| Modifier and Type | Method and Description |
|---|---|
RefreshTokenSpec |
getRefreshTokenSpec()
Returns the refresh token specification.
|
boolean |
isLongLived()
Returns the authorisation lifetime.
|
static PasswordGrantAuthorization |
parse(net.minidev.json.JSONObject jsonObject)
Parses a password grant authorisation from the specified JSON
object.
|
static PasswordGrantAuthorization |
parse(String json)
Parses a password grant authorisation from the specified JSON
object string.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this authorisation.
|
getACR, getAMRList, getAuthTime, getClaimsSpec, getIDTokenSpec, getSubjectgetAccessTokenSpec, getAudience, getData, getScopepublic PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope)
subject - The subject (end-user) identifier. Must not
be null.scope - The authorised scope values. Must not be
null.public PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope, List<com.nimbusds.oauth2.sdk.id.Audience> audList, boolean longLived, AccessTokenSpec accessTokenSpec, RefreshTokenSpec refreshTokenSpec, net.minidev.json.JSONObject data)
subject - The subject (end-user) identifier. Must not
be null.scope - The authorised scope values. Must not be
null.audList - Explicit list of audiences for the access
token, null if not specified.longLived - Controls the authorisation lifetime,
true for a long-lived (implies
persistence), false for a
short-lived (transient).accessTokenSpec - The access token specification. Must not
be null.refreshTokenSpec - The refresh token specification. Must not
be null.data - Additional data as a JSON object,
null if not specified.public PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, Date authTime, com.nimbusds.openid.connect.sdk.claims.ACR acr, List<com.nimbusds.openid.connect.sdk.claims.AMR> amrList, com.nimbusds.oauth2.sdk.Scope scope, List<com.nimbusds.oauth2.sdk.id.Audience> audList, boolean longLived, AccessTokenSpec accessTokenSpec, RefreshTokenSpec refreshTokenSpec, IDTokenSpec idTokenSpec, ClaimsSpec claimsSpec, net.minidev.json.JSONObject data)
subject - The subject (end-user) identifier. Must not
be null.authTime - The time of the subject authentication. If
null it will be set to now.
Applies only if an ID token is issued.acr - The Authentication Context Class Reference
(ACR), null if not specified.
Applies only if an ID token is issued.amrList - The Authentication Methods Reference (AMR)
list, null if not specified. Applies
only if an ID token is issued.scope - The authorised scope values. Must not be
null.audList - Explicit list of audiences for the access
token, null if not specified.longLived - Controls the authorisation lifetime.
true for a long-lived (implies
persistence), false for a
short-lived (transient).accessTokenSpec - The access token specification. Must not be
null.refreshTokenSpec - The refresh token specification. Must not be
null.idTokenSpec - The ID token specification. Must not be
null.claimsSpec - The claims specification.data - Additional data as a JSON object,
null if not specified.public PasswordGrantAuthorization(com.nimbusds.oauth2.sdk.id.Subject subject, com.nimbusds.oauth2.sdk.Scope scope, boolean longLived, AccessTokenSpec accessTokenSpec, RefreshTokenSpec refreshTokenSpec, IDTokenSpec idTokenSpec, ClaimsSpec claimsSpec, net.minidev.json.JSONObject data)
subject - The subject (end-user) identifier. Must not
be null.scope - The authorised scope values. Must not be
null.longLived - Controls the authorisation lifetime.
true for a long-lived (implies
persistence), false for a
short-lived (transient).accessTokenSpec - The access token specification. Must not be
null.refreshTokenSpec - The refresh token specification. Must not be
null.idTokenSpec - The ID token specification. Must not be
null.claimsSpec - The claims specification.data - Additional data as a JSON object,
null if not specified.public boolean isLongLived()
true for a long-lived authorisation (implies
persistence), false for a short-lived (transient).public RefreshTokenSpec getRefreshTokenSpec()
public net.minidev.json.JSONObject toJSONObject()
GrantAuthorizationtoJSONObject in class SubjectAuthorizationpublic static PasswordGrantAuthorization parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException
jsonObject - The JSON object to parse. Must not be
null.com.nimbusds.oauth2.sdk.ParseException - If parsing failed.public static PasswordGrantAuthorization parse(String json) throws com.nimbusds.oauth2.sdk.ParseException
json - The JSON object string to parse. Must not be
null.com.nimbusds.oauth2.sdk.ParseException - If parsing failed.Copyright © 2020 Connect2id Ltd.. All rights reserved.