OAuth2AuthorizationServerMetadata
Struct Stable
Static OAuth2 authorization server metadata for custom credential providers.
| Source | aws-bedrockagentcore/lib/identity/oauth2-credential-provider.ts |
|---|---|
| Type last changed |
Example
ts
agentcore.OAuth2CredentialProvider.usingCustom(this, "CustomOAuthMeta", {
clientId: "your-client-id",
clientSecret: cdk.SecretValue.unsafePlainText("your-client-secret"),
authorizationServerMetadata: {
issuer: "https://idp.example.com",
authorizationEndpoint: "https://idp.example.com/oauth2/authorize",
tokenEndpoint: "https://idp.example.com/oauth2/token",
},
});
python
agentcore.OAuth2CredentialProvider.using_custom(self, "CustomOAuthMeta",
client_id="your-client-id",
client_secret=cdk.SecretValue.unsafe_plain_text("your-client-secret"),
authorization_server_metadata=agentcore.OAuth2AuthorizationServerMetadata(
issuer="https://idp.example.com",
authorization_endpoint="https://idp.example.com/oauth2/authorize",
token_endpoint="https://idp.example.com/oauth2/token"
)
)
java
OAuth2CredentialProvider.usingCustom(this, "CustomOAuthMeta", CustomOAuth2CredentialProviderProps.builder()
.clientId("your-client-id")
.clientSecret(SecretValue.unsafePlainText("your-client-secret"))
.authorizationServerMetadata(OAuth2AuthorizationServerMetadata.builder()
.issuer("https://idp.example.com")
.authorizationEndpoint("https://idp.example.com/oauth2/authorize")
.tokenEndpoint("https://idp.example.com/oauth2/token")
.build())
.build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
OAuth2CredentialProvider.UsingCustom(this, "CustomOAuthMeta", new CustomOAuth2CredentialProviderProps {
ClientId = "your-client-id",
ClientSecret = SecretValue.UnsafePlainText("your-client-secret"),
AuthorizationServerMetadata = new OAuth2AuthorizationServerMetadata {
Issuer = "https://idp.example.com",
AuthorizationEndpoint = "https://idp.example.com/oauth2/authorize",
TokenEndpoint = "https://idp.example.com/oauth2/token"
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
agentcore.OAuth2CredentialProvider_UsingCustom(this, jsii.String("CustomOAuthMeta"), &CustomOAuth2CredentialProviderProps{
ClientId: jsii.String("your-client-id"),
ClientSecret: cdk.SecretValue_UnsafePlainText(jsii.String("your-client-secret")),
AuthorizationServerMetadata: &OAuth2AuthorizationServerMetadata{
Issuer: jsii.String("https://idp.example.com"),
AuthorizationEndpoint: jsii.String("https://idp.example.com/oauth2/authorize"),
TokenEndpoint: jsii.String("https://idp.example.com/oauth2/token"),
},
})
Properties
authorizationEndpointstringauthorization_endpointstrauthorizationEndpointStringAuthorizationEndpointstringAuthorizationEndpoint*string required #The authorization endpoint URL.
The issuer URL for the OAuth2 authorization server.
responseTypesoptionalstring[]response_typesoptionaltyping.List[str]responseTypesoptionalList<String>ResponseTypesoptionalstring[]ResponseTypesoptional*[]*string #The supported response types.
Default: not specified
tokenEndpointstringtoken_endpointstrtokenEndpointStringTokenEndpointstringTokenEndpoint*string required #The token endpoint URL.