Class MutableAccessTokenAuthorization
- java.lang.Object
-
- com.nimbusds.openid.connect.provider.spi.tokens.MutableAccessTokenAuthorization
-
- All Implemented Interfaces:
AccessTokenAuthorization
public final class MutableAccessTokenAuthorization extends Object implements AccessTokenAuthorization
Mutable access token authorisation.
-
-
Constructor Summary
Constructors Constructor Description MutableAccessTokenAuthorization()Creates a new empty mutable access token authorisation.MutableAccessTokenAuthorization(AccessTokenAuthorization source)Creates a new mutable access token authorisation from the specified one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.nimbusds.oauth2.sdk.id.ActorgetActor()Returns the token actor, in impersonation and delegation scenarios.List<com.nimbusds.oauth2.sdk.id.Audience>getAudienceList()Returns the audience list of the token, which may be the logical names of the intended resource servers.Set<String>getClaimNames()Returns the names of the consented OpenID claims to be accessed at the UserInfo endpoint.net.minidev.json.JSONObjectgetClaimsData()Returns the optional claims fulfillment data.List<com.nimbusds.langtag.LangTag>getClaimsLocales()Returns the preferred locales for the consented OpenID claims.com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmationgetClientCertificateConfirmation()Returns the client X.509 certificate confirmation (SHA-256 thumbprint) for mutual TLS.com.nimbusds.oauth2.sdk.id.ClientIDgetClientID()Returns the identifier of the client to which the token is issued.net.minidev.json.JSONObjectgetData()Returns the optional data for the token.InstantgetExpirationTime()Returns the expiration time of the token.com.nimbusds.oauth2.sdk.id.IssuergetIssuer()Returns the issuer of the token.InstantgetIssueTime()Returns the issue time of the token.com.nimbusds.oauth2.sdk.id.JWTIDgetJWTID()Returns the JSON Web Token (JWT) identifier of the token.Map<String,Object>getOtherTopLevelParameters()Returns a map of other top-level parameters.net.minidev.json.JSONObjectgetPresetClaims()Returns the preset OpenID claims to be included in the UserInfo response.com.nimbusds.oauth2.sdk.ScopegetScope()Returns the scope of the token.com.nimbusds.oauth2.sdk.id.SubjectgetSubject()Returns the token subject.StringtoString()MutableAccessTokenAuthorizationwithActor(com.nimbusds.oauth2.sdk.id.Actor act)Sets the token actor, in impersonation and delegation scenarios.MutableAccessTokenAuthorizationwithAudienceList(List<com.nimbusds.oauth2.sdk.id.Audience> audList)Sets the audience list of the token, which may be the logical names of the intended resource servers.MutableAccessTokenAuthorizationwithClaimNames(Set<String> claimNames)Sets the names of the consented OpenID claims to be accessed at the UserInfo endpoint.MutableAccessTokenAuthorizationwithClaimsData(net.minidev.json.JSONObject claimsData)Sets the claims fulfillment data for the claims source at the UserInfo endpoint.MutableAccessTokenAuthorizationwithClaimsLocales(List<com.nimbusds.langtag.LangTag> claimsLocales)Sets the preferred locales for the consented OpenID claims.MutableAccessTokenAuthorizationwithClientCertificateConfirmation(com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmation cnfX5t)Sets the client X.509 certificate confirmation (SHA-256 thumbprint) for mutual TLS.MutableAccessTokenAuthorizationwithClientID(com.nimbusds.oauth2.sdk.id.ClientID clientID)Sets the identifier of the client to which the token is issued.MutableAccessTokenAuthorizationwithData(net.minidev.json.JSONObject data)Sets the optional data for the token.MutableAccessTokenAuthorizationwithExpirationTime(Instant exp)Sets the expiration time of the token.MutableAccessTokenAuthorizationwithIssuer(com.nimbusds.oauth2.sdk.id.Issuer iss)Sets the issuer of the token.MutableAccessTokenAuthorizationwithIssueTime(Instant iat)Sets the issue time of the token.MutableAccessTokenAuthorizationwithJWTID(com.nimbusds.oauth2.sdk.id.JWTID jti)Sets the JSON Web Token (JWT) identifier of the token.MutableAccessTokenAuthorizationwithOtherTopLevelParameters(Map<String,Object> params)Sets the other top-level parameters.MutableAccessTokenAuthorizationwithPresetClaims(net.minidev.json.JSONObject presetClaims)Sets the preset OpenID claims to be included in the UserInfo response.MutableAccessTokenAuthorizationwithScope(com.nimbusds.oauth2.sdk.Scope scope)Sets the scope of the token.MutableAccessTokenAuthorizationwithSubject(com.nimbusds.oauth2.sdk.id.Subject sub)Sets the token subject.
-
-
-
Constructor Detail
-
MutableAccessTokenAuthorization
public MutableAccessTokenAuthorization()
Creates a new empty mutable access token authorisation.
-
MutableAccessTokenAuthorization
public MutableAccessTokenAuthorization(AccessTokenAuthorization source)
Creates a new mutable access token authorisation from the specified one.- Parameters:
source- The source access token authorisation. Must not benull.
-
-
Method Detail
-
withSubject
public MutableAccessTokenAuthorization withSubject(com.nimbusds.oauth2.sdk.id.Subject sub)
Sets the token subject.- Parameters:
sub- The subject,nullif not specified.- Returns:
- This object.
-
getSubject
public com.nimbusds.oauth2.sdk.id.Subject getSubject()
Description copied from interface:AccessTokenAuthorizationReturns the token subject.- Specified by:
getSubjectin interfaceAccessTokenAuthorization- Returns:
- The subject,
nullif not specified.
-
withActor
public MutableAccessTokenAuthorization withActor(com.nimbusds.oauth2.sdk.id.Actor act)
Sets the token actor, in impersonation and delegation scenarios.- Parameters:
act- The actor,nullif not specified.- Returns:
- This object.
-
getActor
public com.nimbusds.oauth2.sdk.id.Actor getActor()
Description copied from interface:AccessTokenAuthorizationReturns the token actor, in impersonation and delegation scenarios.- Specified by:
getActorin interfaceAccessTokenAuthorization- Returns:
- The actor,
nullif not specified.
-
withClientID
public MutableAccessTokenAuthorization withClientID(com.nimbusds.oauth2.sdk.id.ClientID clientID)
Sets the identifier of the client to which the token is issued.- Parameters:
clientID- The client identifier,nullif not specified.- Returns:
- This object.
-
getClientID
public com.nimbusds.oauth2.sdk.id.ClientID getClientID()
Description copied from interface:AccessTokenAuthorizationReturns the identifier of the client to which the token is issued.- Specified by:
getClientIDin interfaceAccessTokenAuthorization- Returns:
- The client identifier,
nullif not specified.
-
withScope
public MutableAccessTokenAuthorization withScope(com.nimbusds.oauth2.sdk.Scope scope)
Sets the scope of the token.- Parameters:
scope- The scope,nullif not specified.- Returns:
- This object.
-
getScope
public com.nimbusds.oauth2.sdk.Scope getScope()
Description copied from interface:AccessTokenAuthorizationReturns the scope of the token.- Specified by:
getScopein interfaceAccessTokenAuthorization- Returns:
- The scope,
nullif not specified.
-
withExpirationTime
public MutableAccessTokenAuthorization withExpirationTime(Instant exp)
Sets the expiration time of the token.- Parameters:
exp- The expiration time,nullif not specified.- Returns:
- This object.
-
getExpirationTime
public Instant getExpirationTime()
Description copied from interface:AccessTokenAuthorizationReturns the expiration time of the token.- Specified by:
getExpirationTimein interfaceAccessTokenAuthorization- Returns:
- The expiration time,
nullif not specified.
-
withIssueTime
public MutableAccessTokenAuthorization withIssueTime(Instant iat)
Sets the issue time of the token.- Parameters:
iat- The issue time,nullif not specified.- Returns:
- This object.
-
getIssueTime
public Instant getIssueTime()
Description copied from interface:AccessTokenAuthorizationReturns the issue time of the token.- Specified by:
getIssueTimein interfaceAccessTokenAuthorization- Returns:
- The issue time,
nullif not specified.
-
withIssuer
public MutableAccessTokenAuthorization withIssuer(com.nimbusds.oauth2.sdk.id.Issuer iss)
Sets the issuer of the token.- Parameters:
iss- The issuer,nullif not specified.- Returns:
- This object.
-
getIssuer
public com.nimbusds.oauth2.sdk.id.Issuer getIssuer()
Description copied from interface:AccessTokenAuthorizationReturns the issuer of the token.- Specified by:
getIssuerin interfaceAccessTokenAuthorization- Returns:
- The issuer,
nullif not specified.
-
withAudienceList
public MutableAccessTokenAuthorization withAudienceList(List<com.nimbusds.oauth2.sdk.id.Audience> audList)
Sets the audience list of the token, which may be the logical names of the intended resource servers.- Parameters:
audList- The audience list,nullif not specified.- Returns:
- This object.
-
getAudienceList
public List<com.nimbusds.oauth2.sdk.id.Audience> getAudienceList()
Description copied from interface:AccessTokenAuthorizationReturns the audience list of the token, which may be the logical names of the intended resource servers.- Specified by:
getAudienceListin interfaceAccessTokenAuthorization- Returns:
- The audience list,
nullif not specified.
-
withJWTID
public MutableAccessTokenAuthorization withJWTID(com.nimbusds.oauth2.sdk.id.JWTID jti)
Sets the JSON Web Token (JWT) identifier of the token.- Parameters:
jti- The JWT ID,nullif not specified or applicable.- Returns:
- This object.
-
getJWTID
public com.nimbusds.oauth2.sdk.id.JWTID getJWTID()
Description copied from interface:AccessTokenAuthorizationReturns the JSON Web Token (JWT) identifier of the token.- Specified by:
getJWTIDin interfaceAccessTokenAuthorization- Returns:
- The JWT ID,
nullif not specified or applicable.
-
withClaimNames
public MutableAccessTokenAuthorization withClaimNames(Set<String> claimNames)
Sets the names of the consented OpenID claims to be accessed at the UserInfo endpoint.- Parameters:
claimNames- The claim names,nullif not specified.- Returns:
- This object.
-
getClaimNames
public Set<String> getClaimNames()
Description copied from interface:AccessTokenAuthorizationReturns the names of the consented OpenID claims to be accessed at the UserInfo endpoint.- Specified by:
getClaimNamesin interfaceAccessTokenAuthorization- Returns:
- The claim names,
nullif not specified.
-
withClaimsLocales
public MutableAccessTokenAuthorization withClaimsLocales(List<com.nimbusds.langtag.LangTag> claimsLocales)
Sets the preferred locales for the consented OpenID claims.- Parameters:
claimsLocales- The preferred claims locales,nullif not specified.- Returns:
- This object.
-
getClaimsLocales
public List<com.nimbusds.langtag.LangTag> getClaimsLocales()
Description copied from interface:AccessTokenAuthorizationReturns the preferred locales for the consented OpenID claims.- Specified by:
getClaimsLocalesin interfaceAccessTokenAuthorization- Returns:
- The preferred claims locales,
nullif not specified.
-
withPresetClaims
public MutableAccessTokenAuthorization withPresetClaims(net.minidev.json.JSONObject presetClaims)
Sets the preset OpenID claims to be included in the UserInfo response.- Parameters:
presetClaims- The preset OpenID claims,nullif not specified.- Returns:
- This object.
-
getPresetClaims
public net.minidev.json.JSONObject getPresetClaims()
Description copied from interface:AccessTokenAuthorizationReturns the preset OpenID claims to be included in the UserInfo response.- Specified by:
getPresetClaimsin interfaceAccessTokenAuthorization- Returns:
- The preset OpenID claims,
nullif not specified.
-
withClaimsData
public MutableAccessTokenAuthorization withClaimsData(net.minidev.json.JSONObject claimsData)
Sets the claims fulfillment data for the claims source at the UserInfo endpoint.- Parameters:
claimsData- The claims fulfillment data,nullif not specified.- Returns:
- This object.
-
getClaimsData
public net.minidev.json.JSONObject getClaimsData()
Description copied from interface:AccessTokenAuthorizationReturns the optional claims fulfillment data.- Specified by:
getClaimsDatain interfaceAccessTokenAuthorization- Returns:
- The claims fulfillment data,
nullif not specified.
-
withData
public MutableAccessTokenAuthorization withData(net.minidev.json.JSONObject data)
Sets the optional data for the token.- Parameters:
data- The optional data, represented as a JSON object,nullif not specified.- Returns:
- This object.
-
getData
public net.minidev.json.JSONObject getData()
Description copied from interface:AccessTokenAuthorizationReturns the optional data for the token.- Specified by:
getDatain interfaceAccessTokenAuthorization- Returns:
- The optional data, represented as a JSON object,
nullif not specified.
-
withClientCertificateConfirmation
public MutableAccessTokenAuthorization withClientCertificateConfirmation(com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmation cnfX5t)
Sets the client X.509 certificate confirmation (SHA-256 thumbprint) for mutual TLS.- Parameters:
cnfX5t- The client X.509 certificate confirmation,nullif not specified.- Returns:
- This object.
-
getClientCertificateConfirmation
public com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmation getClientCertificateConfirmation()
Description copied from interface:AccessTokenAuthorizationReturns the client X.509 certificate confirmation (SHA-256 thumbprint) for mutual TLS.- Specified by:
getClientCertificateConfirmationin interfaceAccessTokenAuthorization- Returns:
- The client X.509 certificate confirmation,
nullif not specified.
-
withOtherTopLevelParameters
public MutableAccessTokenAuthorization withOtherTopLevelParameters(Map<String,Object> params)
Sets the other top-level parameters.- Parameters:
params- Other top-level parameters, the values should map to JSON entities,nullif none.- Returns:
- This object.
-
getOtherTopLevelParameters
public Map<String,Object> getOtherTopLevelParameters()
Description copied from interface:AccessTokenAuthorizationReturns a map of other top-level parameters.- Specified by:
getOtherTopLevelParametersin interfaceAccessTokenAuthorization- Returns:
- Other top-level parameters, the values should map to JSON
entities,
nullif none.
-
-