AOAuth2Application
Subclass for any Application backed by OAuth2.
import AOAuth2Application from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/OAuth2/AOAuth2Application';
Inheritance #
AApplication -> AOAuth2Application
Methods you implement #
In addition to the base methods inherited from AApplication:
| Method | Returns | Purpose |
|---|---|---|
getAuthUrl() | string | Provider's authorization endpoint. |
getTokenUrl() | string | Provider's token endpoint. |
getScopes() | string[] | Scopes to request during authorization. |
Methods provided #
| Method | Returns | Purpose |
|---|---|---|
getAccessToken(install) | string | Current access token, refreshed by the platform if expired. |
refreshAuthorization(install) | Promise<ApplicationInstall> | Force refresh; called automatically by the platform. |
getAuthorizationToken(install, redirectUrl) | string | Builds the authorize URL the Admin UI redirects the user to. |
setAuthorizationToken(install, token) | Promise<ApplicationInstall> | Stores the token returned by the provider's callback. |
Example #
See Development: OAuth2 Application for a complete worked example.
See also #
- ABasicApplication
- ApplicationInstall
- PHP equivalent:
OAuth2ApplicationAbstract