Function OAuthSession.handleAccessTokenResponse

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

void handleAccessTokenResponse (
  vibe.data.json.Json atr,
  std.datetime.systime.SysTime timestamp = SysTime(0L, Rebindable(null, )),
  bool isReload = false
) @safe;

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.

Parameters

NameDescription
atr Access token response
timestamp (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 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.