Ir al contenido
v2.7

Actualizar OAuth2 Google del proyecto

Update the project OAuth2 Google configuration.

PATCH/project/oauth2/googleAlcance project.oauth2.write

SDK: solo @owbase/node

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. Valores: 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.

Acceso: clave de API con el alcance project.oauth2.write.

200Éxito
400Parámetro inválido o faltante
401Sin sesión, sin permiso en el recurso o clave sin el alcance
429Límite de peticiones

Todo error llega como JSON con code, type y message: consulta Errores.

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
});
Respuesta200 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"
]
}

Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?