OAuthInternetAccount
Auto-generated from the config schema in the source. See the config guide for concepts. Provided by the authentication plugin. View source.
Signs requests to a resource that uses OAuth 2.0, fetching and refreshing the access token through the provider's authorization flow.
Example usage
Any OAuth 2.0 provider, with its endpoints supplied. Register the JBrowse
page's URL as a redirect URI with the provider, and use needsPKCE, since a
static app has nowhere to keep a client secret.
{
type: 'OAuthInternetAccount',
internetAccountId: 'myOAuth',
name: 'Institutional login',
domains: ['data.myinstitution.org'],
clientId: 'your-client-id',
authEndpoint: 'https://auth.myinstitution.org/oauth/authorize',
tokenEndpoint: 'https://auth.myinstitution.org/oauth/token',
needsPKCE: true,
}Related links
- Extended by: DropboxOAuthInternetAccount
- Extended by: GoogleDriveOAuthInternetAccount
- State model: runtime API
- Base config: BaseInternetAccount
- Config guide: Authentication
Config slots
Account slots are top-level fields of the account's entry in internetAccounts. Slot types (fileLocation, frozen, ...) are explained in the config slot types reference. Slots a base configuration contributes are listed here too, so this table is the whole surface.
| Slot | Description |
|---|---|
tokenTypestring = 'Bearer' |
a custom name for a token to include in the header |
authEndpointstring = '' |
the authorization code endpoint of the internet account |
tokenEndpointstring = '' |
the token endpoint of the internet account |
needsPKCEboolean = false |
boolean to indicate if the endpoint needs a PKCE code |
clientIdstring = '' |
id for the OAuth application |
scopesstring = '' |
optional scopes for the authorization call |
responseTypestring = 'code' |
the type of response from the authorization endpoint. can be 'token' or 'code' |
| Inherited from BaseInternetAccount | 4 slots |
namestring = '' |
descriptive name of the internet account |
descriptionstring = '' |
a description of the internet account |
authHeaderstring = 'Authorization' |
request header for credentials |
domainsstringArray = [] |
array of valid domains the url can contain to use this account |