setOAuthScopeMapping()
Configures backend permission mapping for one OAuth scope.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function setScopeMapping(oauthAppSlug: string, scope: string) { const client = await wachtClient(); return client.oauth.setOAuthScopeMapping(oauthAppSlug, scope, { permission: 'users:read', });}Signature
function setOAuthScopeMapping( oauthAppSlug: string, scope: string, request: SetOAuthScopeMappingRequest,): Promise<OAuthApp>SetOAuthScopeMappingRequest
›oauthAppSlug: string;
oauthAppSlug: string;OAuth app slug.
›scope: string;
scope: string;OAuth/skills scope key for the operation.
›request: SetOAuthScopeMappingRequest;
request: SetOAuthScopeMappingRequest;Request payload object sent to the backend API.
›permission?: string | undefined;
permission?: string | undefined;permission value used by this request.
Return value
›slug?: string | undefined;
slug?: string | undefined;OAuth app slug.
›name?: string | undefined;
name?: string | undefined;OAuth app display name.
›supported_scopes?: string[] | undefined;
supported_scopes?: string[] | undefined;Configured supported scope names.
›allow_dynamic_client_registration?: boolean | undefined;
allow_dynamic_client_registration?: boolean | undefined;Whether dynamic client registration is enabled.