SstOAuth2Credentials
I represent access credentials (most essentially an access token) for the resource endpoints protected by the OAuth2.0 framework for authentication and authorization.
Instances of this class can be serialized as JSON for storage.
Class Methods
deserializeFrom:
  Creates a new instance of SstOAuth2Credentials by reading the JSON serialization from the argument stream.
     
     Arguments:
        aStream - <ReadStream>
Instance Methods
accessToken
  Return the access token.
     
     Returns:
        <String>
canRefresh
  Can these credentials be refreshed using a refresh token?
     In other words: is there a refresh token?
     
     Returns:
        <Boolean>
expiresOn
  Return the expiration time after which these credentials are no longer valid.
     
     Returns:
        <DateAndTime>
isExpired
  If there is an expiration time available, returns true if these credentials are expired.
     Returns false in all other cases.
     
     Returns:
        <Boolean>
refreshToken
  Return the refresh token.
     
     Returns:
        <String> or nil when no refresh token is present.
refreshWithClientId:secret:
  Trigger the refresh of the access token, using the given client id and secret.
     Returns a new instance of SstOAuth2Credentials.
     
     Arguments:
        idString - <String> client id
        secretString - <String> client secret
     Returns:
        <SstOAuth2Credentials>
    Raises:
        <SstOAuth2Error> when these credentials cannot be refreshed.
refreshWithClientId:secret:useBasicAuth:
  Trigger the refresh of the access token, using the given client id and secret.
     Returns a new instance of SstOAuth2Credentials.
     
     Arguments:
        idString - <String> client id
        secretString - <String> client secret
        useBasicAuth - <Boolean> use basic authentication method (recommended) when true
     Returns:
        <SstOAuth2Credentials>
    Raises:
        <SstOAuth2Error> when these credentials cannot be refreshed.
scope
  Return the scope parameter.
     
     Returns:
        <String> or nil when no scope parameter is present.
serializeOn:
  Serialize these credentials as JSON on the stream argument.
     
     Arguments:
        writeStream - <WriteStream>
tokenType
  Return the token type.
     Currently, only 'bearer' is supported.
     
     Returns:
        <String>
tokenUrl
  Return the access token endpoint URL.
     
     Returns:
        <SstUrl>
tokenUrl:
  Set the access token endpoint URL.
     
     Arguments:
        <SstUrl>
Last modified date: 01/09/2026