(require("auth/OAuth2ThreeLegged"))()
Constructs a new OAuth2ThreeLegged.
Inherits from OAuth2
- Source:
Methods
generateAuthUrl(state, flow)
Get Authorize URL
Parameters:
| Name | Type | Description |
|---|---|---|
state |
String | parameter that allows you to restore the previous state of your application |
flow |
String | enum string to define the grant flow type [code: Code grant type, token: Implicit grant type]. Default: code |
- Source:
Returns:
String
getToken(code)
Get a 3-legged access token
Parameters:
| Name | Type | Description |
|---|---|---|
code |
String | The code that needs to be exchanged to get the access token |
- Source:
Returns:
Promise
refreshToken(credentials, scope)
Refresh a 3-legged token
Parameters:
| Name | Type | Description |
|---|---|---|
credentials |
name-value pairs (refresh_token) |
|
scope |
optional scope for new token. It must be subset of the scopes used for original token. |
- Source:
Returns:
Promise