Class FromOauthIdentityOptions
(experimental) OAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
Assembly: Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.dll
Syntax (csharp)
public class FromOauthIdentityOptions : IFromOauthIdentityOptions
Syntax (vb)
Public Class FromOauthIdentityOptions Implements IFromOauthIdentityOptions
Remarks
Stability: Experimental
ExampleMetadata: fixture=default infused
Examples
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
GatewayName = "my-gateway"
});
var oauth = OAuth2CredentialProvider.UsingGithub(this, "GhOAuth", new GithubOAuth2CredentialProviderProps {
OAuth2CredentialProviderName = "github-oauth",
ClientId = "your-client-id",
ClientSecret = SecretValue.UnsafePlainText("your-client-secret")
});
gateway.AddMcpServerTarget("Mcp", new AddMcpServerTargetOptions {
GatewayTargetName = "mcp-server",
Description = "MCP with GitHub OAuth",
Endpoint = "https://my-mcp-server.example.com",
CredentialProviderConfigurations = new [] { GatewayCredentialProvider.FromOauthIdentity(oauth, new FromOauthIdentityOptions {
Scopes = new [] { "read:user" }
}) }
});
Synopsis
Constructors
| FromOauthIdentityOptions() | (experimental) OAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target. |
Properties
| CustomParameters | (experimental) Additional OAuth parameters for the provider. |
| Scopes | (experimental) OAuth scopes the gateway should request for this target. |
Constructors
FromOauthIdentityOptions()
(experimental) OAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target.
public FromOauthIdentityOptions()
Remarks
Stability: Experimental
ExampleMetadata: fixture=default infused
Examples
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
GatewayName = "my-gateway"
});
var oauth = OAuth2CredentialProvider.UsingGithub(this, "GhOAuth", new GithubOAuth2CredentialProviderProps {
OAuth2CredentialProviderName = "github-oauth",
ClientId = "your-client-id",
ClientSecret = SecretValue.UnsafePlainText("your-client-secret")
});
gateway.AddMcpServerTarget("Mcp", new AddMcpServerTargetOptions {
GatewayTargetName = "mcp-server",
Description = "MCP with GitHub OAuth",
Endpoint = "https://my-mcp-server.example.com",
CredentialProviderConfigurations = new [] { GatewayCredentialProvider.FromOauthIdentity(oauth, new FromOauthIdentityOptions {
Scopes = new [] { "read:user" }
}) }
});
Properties
CustomParameters
(experimental) Additional OAuth parameters for the provider.
public IDictionary<string, string>? CustomParameters { get; set; }
Property Value
Remarks
Default: - none
Stability: Experimental
Scopes
(experimental) OAuth scopes the gateway should request for this target.
public string[] Scopes { get; set; }
Property Value
string[]
Remarks
Stability: Experimental