Skip to content
v2.7

Update project OAuth2 Google

Update the project OAuth2 Google configuration.

PATCH/project/oauth2/googleScope project.oauth2.write

SDK: @owbase/node only

Update the project OAuth2 Google configuration.

clientId string

‘Client ID’ of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com

clientSecret string

‘Client Secret’ of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj

prompt ProjectOAuth2GooglePrompt[]

Array of Google OAuth2 prompt values. If “none” is included, it must be the only element. “none” means: don’t display any authentication or consent screens. Must not be specified with other values. “consent” means: prompt the user for consent. “select_account” means: prompt the user to select an account. Values: none, consent, select_account.

enabled boolean

Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.

nativeClientIds string[]

Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.

nativeEnabled boolean

Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code.

Access: API key with the project.oauth2.write scope.

200Success
400Invalid or missing parameter
401No session, no permission on the resource or key without the scope
429Rate limit

Every error comes as JSON with code, type and message: see Errors.

import { Client, Project, ProjectOAuth2GooglePrompt } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const project = new Project(client);
const result = await project.updateOAuth2Google({
clientId: '<CLIENT_ID>', // optional
clientSecret: '<CLIENT_SECRET>', // optional
prompt: [ProjectOAuth2GooglePrompt.None], // optional
enabled: false, // optional
nativeClientIds: [], // optional
nativeEnabled: false, // optional
});
Response200 OK
{
"$id": "github",
"enabled": false,
"clientId": "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com",
"clientSecret": "GOCSPX-2k8gsR0000000000000000VNahJj",
"prompt": [
"consent"
],
"nativeEnabled": false,
"nativeClientIds": [
"YOUR_ANDROID_CLIENT_ID.apps.googleusercontent.com"
]
}

The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.

Was this page helpful?