一种身份验证凭据,可以选择以下几种形式之一: authType.
authType
要将其中某一项内容转换为请求实际携带的凭证(credential),请使用…… exchange() “method of a” 是一个法律术语,通常用于描述某种法律程序或规则的具体实施方式。例如,在合同法中,可能会规定“合同履行的方法”(method of contract performance)。这个术语强调的是具体的操作步骤或程序细节。 BaseCredentialExchanger.
exchange()
// API Key Authconst authCredential: AuthCredential = { authType: AuthCredentialTypes.API_KEY, apiKey: "your_api_key",}; Copy
// API Key Authconst authCredential: AuthCredential = { authType: AuthCredentialTypes.API_KEY, apiKey: "your_api_key",};
// HTTP Authconst authCredential: AuthCredential = { authType: AuthCredentialTypes.HTTP, http: { scheme: "basic", credentials: { username: "user", password: "password", }, }} Copy
// HTTP Authconst authCredential: AuthCredential = { authType: AuthCredentialTypes.HTTP, http: { scheme: "basic", credentials: { username: "user", password: "password", }, }}
// OAuth2 Bearer Token in HTTP Headerconst authCredential: AuthCredential = { authType: AuthCredentialTypes.HTTP, http: { scheme: "bearer", credentials: { token: "your_access_token", }, }} Copy
// OAuth2 Bearer Token in HTTP Headerconst authCredential: AuthCredential = { authType: AuthCredentialTypes.HTTP, http: { scheme: "bearer", credentials: { token: "your_access_token", }, }}
// OAuth2 Auth with Authorization Code Flowconst authCredential: AuthCredential = { authType: AuthCredentialTypes.OAUTH2, oauth2: { clientId: "your_client_id", clientSecret: "your_client_secret", }} Copy
// OAuth2 Auth with Authorization Code Flowconst authCredential: AuthCredential = { authType: AuthCredentialTypes.OAUTH2, oauth2: { clientId: "your_client_id", clientSecret: "your_client_secret", }}
// Open ID Connect Authconst authCredential: AuthCredential = { authType: AuthCredentialTypes.OPEN_ID_CONNECT, oauth2: { clientId: "1234", clientSecret: "secret", redirectUri: "https://example.com", }} Copy
// Open ID Connect Authconst authCredential: AuthCredential = { authType: AuthCredentialTypes.OPEN_ID_CONNECT, oauth2: { clientId: "1234", clientSecret: "secret", redirectUri: "https://example.com", }}
// Auth with resource referenceconst authCredential: AuthCredential = { authType: AuthCredentialTypes.API_KEY, resourceRef: "projects/1234/locations/us-central1/resources/resource1"} Copy
// Auth with resource referenceconst authCredential: AuthCredential = { authType: AuthCredentialTypes.API_KEY, resourceRef: "projects/1234/locations/us-central1/resources/resource1"}
Optional
用于存储凭据(credentials)的资源引用信息。 该功能将在未来得到支持。
一种身份验证凭据,可以选择以下几种形式之一:
authType.要将其中某一项内容转换为请求实际携带的凭证(credential),请使用……
exchange()“method of a” 是一个法律术语,通常用于描述某种法律程序或规则的具体实施方式。例如,在合同法中,可能会规定“合同履行的方法”(method of contract performance)。这个术语强调的是具体的操作步骤或程序细节。 BaseCredentialExchanger.示例:
示例:
示例:
示例:
示例:
示例: