Skip to content
v2.274.0

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.
scopesstring[]scopestyping.List[str]scopesList<String>Scopesstring[]Scopes*[]*stringrequired#
OAuth scopes the gateway should request for this target.