Class OptionalTokenSpec

java.lang.Object
com.nimbusds.openid.connect.provider.spi.grants.TokenSpec
com.nimbusds.openid.connect.provider.spi.grants.OptionalTokenSpec
Direct Known Subclasses:
IDTokenSpec, RefreshTokenSpec

@Immutable public class OptionalTokenSpec extends TokenSpec
Optional token specification.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OptionalTokenSpec(boolean issue, long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList, com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject)
    Creates a new optional token specification.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the token issue policy.
    parse(net.minidev.json.JSONObject jsonObject)
    Parses an optional token specification from the specified JSON object.
    net.minidev.json.JSONObject
    Returns a JSON object representation of this token specification.

    Methods inherited from class com.nimbusds.openid.connect.provider.spi.grants.TokenSpec

    getAudience, getImpersonatedSubject, getLifetime, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OptionalTokenSpec

      public OptionalTokenSpec(boolean issue, long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList, com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject)
      Creates a new optional token specification.
      Parameters:
      issue - If true a token must be issued, false to prohibit issue.
      lifetime - The token lifetime, in seconds. For access tokens zero and negative means not specified (to let the Connect2id server apply the default configured access token lifetime). For refresh tokens zero means no lifetime limit and negative means not specified (to let the Connect2id server apply the default configured refresh token lifetime).
      audList - Explicit list of audiences for the token, null if not specified.
      impersonatedSubject - The subject in impersonation and delegation cases, null if not applicable.
  • Method Details

    • issue

      public boolean issue()
      Returns the token issue policy.
      Returns:
      true if a token must be issued, false to prohibit issue.
    • toJSONObject

      public net.minidev.json.JSONObject toJSONObject()
      Description copied from class: TokenSpec
      Returns a JSON object representation of this token specification.
      Overrides:
      toJSONObject in class TokenSpec
      Returns:
      The JSON object.
    • parse

      public static OptionalTokenSpec parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException
      Parses an optional token specification from the specified JSON object.
      Parameters:
      jsonObject - The JSON object. Must not be null.
      Returns:
      The optional token specification.
      Throws:
      com.nimbusds.oauth2.sdk.ParseException - If parsing failed.