Class RefreshTokenSpec

    • Constructor Detail

      • RefreshTokenSpec

        public RefreshTokenSpec()
        Creates a new default refresh token specification (no issue).
      • RefreshTokenSpec

        public RefreshTokenSpec​(boolean issue,
                                long lifetime)
        Creates a new refresh token specification.
        Parameters:
        issue - Controls the refresh token issue. If true a refresh token must be issued (requires a long-lived authorisation), false to prohibit issue.
        lifetime - The refresh token lifetime, in seconds. Zero implies permanent (no expiration) and negative not specified (to let the Connect2id server apply the default configured refresh token lifetime). Applies only if a refresh token is issued.
      • RefreshTokenSpec

        public RefreshTokenSpec​(boolean issue,
                                long lifetime,
                                Optional<Boolean> rotate)
        Creates a new refresh token specification.
        Parameters:
        issue - Controls the refresh token issue. If true a refresh token must be issued (requires a long-lived authorisation), false to prohibit issue.
        lifetime - The refresh token lifetime, in seconds. Zero implies permanent (no expiration) and negative not specified (to let the Connect2id server apply the default configured refresh token lifetime). Applies only if a refresh token is issued.
        rotate - The optional rotation preference, if none the default refresh token rotation policy will apply.
    • Method Detail

      • getRotate

        public Optional<BooleangetRotate()
        Returns the optional refresh token rotation preference.
        Returns:
        The rotation preference, if none the default refresh token rotation policy will apply.
      • 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 OptionalTokenSpec
        Returns:
        The JSON object.
      • parse

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