Constructor
new BasicSession(accessToken, tokenManager)
Parameters:
| Name | Type | Description | 
|---|---|---|
accessToken | 
            
            string | The existing access token for a user | 
tokenManager | 
            
            TokenManager | The token manager | 
- Source:
 
Methods
exchangeToken(scopes, resourceopt, optionsopt) → {Promise.<TokenInfo>}
    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:
    Promise resolving to the new token info
- Type
 - Promise.<TokenInfo>
 
exchangeToken(scopes, resourceopt, optionsopt) → {Promise.<TokenInfo>}
    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:
    Promise resolving to the new token info
- Type
 - Promise.<TokenInfo>
 
getAccessToken() → {Promise.<string>}
    Returns the clients access token. BasicSession never returns an error, since it doesn't
know the status of its own token.
- Source:
 
Returns:
    Promise resolving to the access token
- Type
 - Promise.<string>
 
getAccessToken() → {Promise.<string>}
    Returns the clients access token. BasicSession never returns an error, since it doesn't
know the status of its own token.
- Source:
 
Returns:
    Promise resolving to the access token
- Type
 - Promise.<string>
 
revokeTokens(optionsopt) → {Promise}
    Revokes the session's access token.
    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 session's access token.
    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