Class OAuthSession

Holds an access token and optionally a refresh token.

class OAuthSession ;

Properties

NameTypeDescription
canRefresh[get] boolIndicates whether this session can refresh its access token.
expired[get] bool
expires[get] std.datetime.systime.SysTimeExpiration time of this session's access token.
scopes[get] string[]All scopes this session has authorization for.
signature[get] stringUnique signature of this session.
timestamp[get] std.datetime.systime.SysTimeTimestamp of this session
tokenData[get] const(vibe.data.json.Json)Json object from the access token response

Methods

NameDescription
authorizeRequest (req) Authorize an HTTP request using this session's token.
hasScope (someScope) Indicates whether this session has authorization for the given scope.
load (settings, httpSession) Load OAuthSession data from Vibe.d session.
refresh () Refresh the access token of this session.
save (httpSession) Save this session's data into an HTTP session.
verify (httpSession) Verify if this is the session referenced by the given HTTP session.
handleAccessTokenResponse (atr, timestamp, isReload) Handles the response to an access token request and sets the properties of this session accordingly.