@Immutable public class GrantAuthorization extends Object
GrantHandler
.
Required authorisation details:
All other parameters are optional or have suitable defaults.
Constructor and Description |
---|
GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope)
Creates a new basic authorisation.
|
GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope,
AccessTokenSpec accessTokenSpec,
net.minidev.json.JSONObject data)
Creates a new basic authorisation.
|
GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
AccessTokenSpec accessTokenSpec,
net.minidev.json.JSONObject data)
Creates a new basic authorisation.
|
Modifier and Type | Method and Description |
---|---|
AccessTokenSpec |
getAccessTokenSpec()
Returns the access token specification.
|
List<com.nimbusds.oauth2.sdk.id.Audience> |
getAudience()
Returns the explicit list of audiences for the access token.
|
net.minidev.json.JSONObject |
getData()
Returns the additional data as a JSON object.
|
com.nimbusds.oauth2.sdk.Scope |
getScope()
Returns the authorised scope values.
|
static GrantAuthorization |
parse(net.minidev.json.JSONObject jsonObject)
Parses a basic authorisation from the specified JSON object.
|
static GrantAuthorization |
parse(String json)
Parses a basic authorisation from the specified JSON object string.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this authorisation.
|
public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope)
scope
- The authorised scope values. Must not be null
.public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, AccessTokenSpec accessTokenSpec, net.minidev.json.JSONObject data)
scope
- The authorised scope values. Must not be
null
.accessTokenSpec
- The access token specification. Must not be
null
.data
- Additional data as a JSON object,
null
if not specified.public GrantAuthorization(com.nimbusds.oauth2.sdk.Scope scope, List<com.nimbusds.oauth2.sdk.id.Audience> audList, AccessTokenSpec accessTokenSpec, net.minidev.json.JSONObject data)
scope
- The authorised scope values. Must not be
null
.audList
- Explicit list of audiences for the access
token, null
if not specified.accessTokenSpec
- The access token specification. Must not be
null
.data
- Additional data as a JSON object,
null
if not specified.public com.nimbusds.oauth2.sdk.Scope getScope()
public List<com.nimbusds.oauth2.sdk.id.Audience> getAudience()
null
if not specified.public AccessTokenSpec getAccessTokenSpec()
public net.minidev.json.JSONObject getData()
null
if not specified.public net.minidev.json.JSONObject toJSONObject()
public static GrantAuthorization 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 GrantAuthorization 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 © 2021 Connect2id Ltd.. All rights reserved.