Constructor
new CCGSession(config, tokenManager)
Parameters:
Name | Type | Description |
---|---|---|
config |
Config | The SDK configuration options |
tokenManager |
TokenManager | The TokenManager |
- Source:
Methods
exchangeToken(scopes, resourceopt, optionsopt) → {void}
Exchange the client access token for one with lower scope
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
scopes |
string | Array.<string> | The scope(s) requested for the new token | |||||||||
resource |
string |
<optional> |
The absolute URL of an API resource to scope the new token to | ||||||||
options |
Object |
<optional> |
Optional parameters
Properties
|
- Source:
Returns:
- Type
- void
exchangeToken(scopes, resourceopt, optionsopt) → {void}
Exchange the client access token for one with lower scope
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
scopes |
string | Array.<string> | The scope(s) requested for the new token | |||||||||
resource |
string |
<optional> |
The absolute URL of an API resource to scope the new token to | ||||||||
options |
Object |
<optional> |
Optional parameters
Properties
|
- Source:
Returns:
- Type
- void
getAccessToken(optionsopt) → {Promise.<string>}
Produces a valid, anonymous access token.
Performs a refresh before returning if the current token is expired. If the current
token is considered stale but still valid, return the current token but initiate a
new refresh in the background.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
TokenRequestOptions |
<optional> |
Sets optional behavior for the token grant |
- Source:
Returns:
Promise resolving to the access token
- Type
- Promise.<string>
getAccessToken(optionsopt) → {Promise.<string>}
Produces a valid, anonymous access token.
Performs a refresh before returning if the current token is expired. If the current
token is considered stale but still valid, return the current token but initiate a
new refresh in the background.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
TokenRequestOptions |
<optional> |
Sets optional behavior for the token grant |
- Source:
Returns:
Promise resolving to the access token
- Type
- Promise.<string>
revokeTokens(optionsopt) → {Promise}
Revokes the anonymous token used by this anonymous session, and clears the saved tokenInfo.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
TokenRequestOptions |
<optional> |
Sets optional behavior for the token grant |
- Source:
Returns:
Promise resolving if the revoke succeeds
- Type
- Promise
revokeTokens(optionsopt) → {Promise}
Revokes the anonymous token used by this anonymous session, and clears the saved tokenInfo.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
TokenRequestOptions |
<optional> |
Sets optional behavior for the token grant |
- Source:
Returns:
Promise resolving if the revoke succeeds
- Type
- Promise