OAuthSession.handleAccessTokenResponse

Handles the response to an access token request and sets the properties of this session accordingly.

This method is to be overridden by derived classes to implement support for additional token types and/or extension fields in the response.

The default implementation only supports the the 'bearer' token type and the response fields documented in RFC 6749 sections 5.1 and 5.2.

class OAuthSession
protected
void
handleAccessTokenResponse
(
Json atr
,
SysTime timestamp = SysTime.init
,
bool isReload = false
)

Parameters

atr Json

Access token response

timestamp SysTime

(Optional) Best approximation available of the token generation time. May be used in token expiration time calculations. Clock.currTime is used if timestamp is omitted or set to SysTime.init.

isReload bool

true if this is called in the process of loading a persisted session. If this is true, timestamp is required.

Throws

OAuthException if:

  • atr is an error response;
  • atr is missing required fields;
  • atr contains an unsupported token type;
  • timestamp is not set for a reload.

Meta