GoogleDriveOAuthInternetAccount
Auto-generated from the config schema in the source. See the config guide for concepts. Provided by the authentication plugin. View source.
Signs requests for Google Drive files with an OAuth 2.0 token, with the Google endpoints, read-only Drive scope and domain filled in.
Example usage
The Google endpoints are pre-filled. With the Picker's apiKey and appId
set, the drive.file scope reads the files a user picks and needs no
restricted-scope review from Google; see the authentication guide.
{
type: 'GoogleDriveOAuthInternetAccount',
internetAccountId: 'googleDriveOAuth',
name: 'Google Drive',
clientId: 'your-client-id.apps.googleusercontent.com',
scopes: 'https://www.googleapis.com/auth/drive.file',
apiKey: 'your-browser-api-key',
appId: 'your-cloud-project-number',
}Related links
- State model: runtime API
- Base config: OAuthInternetAccount
- 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 |
|---|---|
authEndpointstring = 'https://accounts.google.com/o/oauth2/v2/auth' |
the authorization code endpoint of the internet account |
scopesstring = 'https://www.googleapis.com/auth/drive.readonly' |
optional scopes for the authorization call |
domainsstringArray = ['drive.google.com'] |
array of valid domains the url can contain to use this account |
responseTypestring = 'token' |
the type of response from the authorization endpoint |
apiKeystring = '' |
Browser API key of the Cloud project that owns clientId, with the Google Picker API enabled. Set it with appId to offer a "Browse Google Drive" button, which lets the account work with the non-restricted https://www.googleapis.com/auth/drive.file scope |
appIdstring = '' |
The Cloud project number, which ties a picked file's drive.file grant to this app |
| Inherited from OAuthInternetAccount | 4 slots |
tokenTypestring = 'Bearer' |
a custom name for a token to include in the header |
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 |
| Inherited from BaseInternetAccount | 3 slots |
namestring = '' |
descriptive name of the internet account |
descriptionstring = '' |
a description of the internet account |
authHeaderstring = 'Authorization' |
request header for credentials |