OAuth2 plugin
QorusOAuth2RestApi::QorusAuthTokenStore Class Reference
Inheritance diagram for QorusOAuth2RestApi::QorusAuthTokenStore:

Public Member Functions

__7_ list< auto > getKeys ()
 
bool hasExpired (string token, int t)
 
 removeToken (string token)
 
bool isEmpty ()
 
QorusAuthToken getToken (string token)
 
string generate (hash cx, __7_ string client_id, timeout duration, int type, __7_ string auth_code)
 
__7_ string validate (hash cx, string token, __7_ string client_id)
 
bool validateAuthorizationCode (hash cx, string token, __7_ string client_id)
 
nothing dropToken (string token)
 

Public Attributes

const TT_ACCESS = 0
 
const TT_REFRESH = 1
 
const TT_AUTHORIZATION = 2
 

Detailed Description

Class to store authentication tokens.

Member Function Documentation

◆ generate()

string QorusOAuth2RestApi::QorusAuthTokenStore::generate ( hash  cx,
__7_ string  client_id,
timeout  duration,
int  type,
__7_ string  auth_code 
)
inline

Generates token

Parameters
cxrequest context
client_idid of OAuht2 client
durationin milliseconds
typetype of token to be generated (TT_ACCESS, TT_AUTHORIZATION, TT_REFRESH)
auth_codeauthorization code issues during authorization step in Authorization Code Grant flow
Returns
token itself

◆ hasExpired()

bool QorusOAuth2RestApi::QorusAuthTokenStore::hasExpired ( string  token,
int  t 
)
inline

Checks if the token is still valid.

◆ removeToken()

QorusOAuth2RestApi::QorusAuthTokenStore::removeToken ( string  token)
inline

Removes token from the store

◆ validate()

__7_ string QorusOAuth2RestApi::QorusAuthTokenStore::validate ( hash  cx,
string  token,
__7_ string  client_id 
)
inline

Validates token

Parameters
cxrequest context
tokentoken to validate
client_idid of OAuht2 client
Returns
string in format "<username>:<client_id>:oauth2"

◆ validateAuthorizationCode()

bool QorusOAuth2RestApi::QorusAuthTokenStore::validateAuthorizationCode ( hash  cx,
string  token,
__7_ string  client_id 
)
inline

Validates authorization token used in Authorization Code Grant flow

Parameters
cxrequest context
tokentoken to validate
client_idid of OAuht2 client
Returns
boolean

The documentation for this class was generated from the following file: