FromOauthIdentityOptions Struct
OAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target.
Example
ts
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
const oauth = agentcore.OAuth2CredentialProvider.usingGithub(this, "GhOAuth", {
oAuth2CredentialProviderName: "github-oauth",
clientId: "your-client-id",
clientSecret: cdk.SecretValue.unsafePlainText("your-client-secret"),
});
gateway.addMcpServerTarget("Mcp", {
gatewayTargetName: "mcp-server",
description: "MCP with GitHub OAuth",
endpoint: "https://my-mcp-server.example.com",
credentialProviderConfigurations: [
agentcore.GatewayCredentialProvider.fromOauthIdentity(oauth, {
scopes: ["read:user"],
}),
],
});
Properties
customParametersoptional{ [key: string]: string }custom_parametersoptionaltyping.Mapping[str, str]customParametersoptionalMap<String, String>CustomParametersoptionalIDictionary<string, string>CustomParametersoptional*map[string]*string= none#Additional OAuth parameters for the provider.
OAuth scopes the gateway should request for this target.