# FromOauthIdentityOptions

OAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target.

- Source: [`aws-bedrockagentcore/lib/gateway/outbound-auth/credential-provider.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/gateway/outbound-auth/credential-provider.ts#L78)
- Type last changed: v2.255.0 · 19 May 2026

## 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

- `customParameters`: { [key: string]: string } = none — Additional OAuth parameters for the provider.

- `scopes`: string[] (required) — OAuth scopes the gateway should request for this target.
