CustomOAuth2CredentialProviderProps Struct
Props for {@link OAuth2CredentialProvider.usingCustom}.
Set exactly one of {@link discoveryUrl} (OIDC discovery document) or {@link authorizationServerMetadata} (static OAuth2 server metadata). Do not pass both.
| Source | lib/identity/oauth2-credential-provider.ts |
|---|
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import * as cdk from 'aws-cdk-lib';
declare const secretValue: cdk.SecretValue;
const customOAuth2CredentialProviderProps: bedrock_agentcore_alpha.CustomOAuth2CredentialProviderProps = {
clientId: 'clientId',
clientSecret: secretValue,
// the properties below are optional
authorizationServerMetadata: {
authorizationEndpoint: 'authorizationEndpoint',
issuer: 'issuer',
tokenEndpoint: 'tokenEndpoint',
// the properties below are optional
responseTypes: ['responseTypes'],
},
discoveryUrl: 'discoveryUrl',
oAuth2CredentialProviderName: 'oAuth2CredentialProviderName',
tags: {
tagsKey: 'tags',
},
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
import aws_cdk as cdk
# secret_value: cdk.SecretValue
custom_o_auth2_credential_provider_props = bedrock_agentcore_alpha.CustomOAuth2CredentialProviderProps(
client_id="clientId",
client_secret=secret_value,
# the properties below are optional
authorization_server_metadata=bedrock_agentcore_alpha.OAuth2AuthorizationServerMetadata(
authorization_endpoint="authorizationEndpoint",
issuer="issuer",
token_endpoint="tokenEndpoint",
# the properties below are optional
response_types=["responseTypes"]
),
discovery_url="discoveryUrl",
o_auth2_credential_provider_name="oAuth2CredentialProviderName",
tags={
"tags_key": "tags"
}
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
import software.amazon.awscdk.*;
SecretValue secretValue;
CustomOAuth2CredentialProviderProps customOAuth2CredentialProviderProps = CustomOAuth2CredentialProviderProps.builder()
.clientId("clientId")
.clientSecret(secretValue)
// the properties below are optional
.authorizationServerMetadata(OAuth2AuthorizationServerMetadata.builder()
.authorizationEndpoint("authorizationEndpoint")
.issuer("issuer")
.tokenEndpoint("tokenEndpoint")
// the properties below are optional
.responseTypes(List.of("responseTypes"))
.build())
.discoveryUrl("discoveryUrl")
.oAuth2CredentialProviderName("oAuth2CredentialProviderName")
.tags(Map.of(
"tagsKey", "tags"))
.build();
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
using Amazon.CDK;
SecretValue secretValue;
var customOAuth2CredentialProviderProps = new CustomOAuth2CredentialProviderProps {
ClientId = "clientId",
ClientSecret = secretValue,
// the properties below are optional
AuthorizationServerMetadata = new OAuth2AuthorizationServerMetadata {
AuthorizationEndpoint = "authorizationEndpoint",
Issuer = "issuer",
TokenEndpoint = "tokenEndpoint",
// the properties below are optional
ResponseTypes = new [] { "responseTypes" }
},
DiscoveryUrl = "discoveryUrl",
OAuth2CredentialProviderName = "oAuth2CredentialProviderName",
Tags = new Dictionary<string, string> {
{ "tagsKey", "tags" }
}
};
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"
var secretValue SecretValue
customOAuth2CredentialProviderProps := &CustomOAuth2CredentialProviderProps{
ClientId: jsii.String("clientId"),
ClientSecret: secretValue,
// the properties below are optional
AuthorizationServerMetadata: &OAuth2AuthorizationServerMetadata{
AuthorizationEndpoint: jsii.String("authorizationEndpoint"),
Issuer: jsii.String("issuer"),
TokenEndpoint: jsii.String("tokenEndpoint"),
// the properties below are optional
ResponseTypes: []*string{
jsii.String("responseTypes"),
},
},
DiscoveryUrl: jsii.String("discoveryUrl"),
OAuth2CredentialProviderName: jsii.String("oAuth2CredentialProviderName"),
Tags: map[string]*string{
"tagsKey": jsii.String("tags"),
},
}
Properties
authorizationServerMetadataoptionalOAuth2AuthorizationServerMetadataauthorization_server_metadataoptionalOAuth2AuthorizationServerMetadataauthorizationServerMetadataoptionalOAuth2AuthorizationServerMetadataAuthorizationServerMetadataoptionalOAuth2AuthorizationServerMetadataAuthorizationServerMetadataoptionalOAuth2AuthorizationServerMetadata #Default: not used when {@link discoveryUrl } is set
clientSecretSecretValueclient_secretSecretValueclientSecretSecretValueClientSecretSecretValueClientSecretSecretValue required #notes
NOTE: The client secret will be included in the CloudFormation template as part of synthesis. The service stores the secret in Secrets Manager after creation, but the value is visible in the template and deployment history. Use SecretValue.unsafePlainText() to explicitly acknowledge plaintext, or pass a reference from another construct to avoid embedding the literal value.
discoveryUrloptionalstringdiscovery_urloptionalstrdiscoveryUrloptionalStringDiscoveryUrloptionalstringDiscoveryUrloptional*string #Default: not used when {@link authorizationServerMetadata } is set
oAuth2CredentialProviderNameoptionalstringo_auth2_credential_provider_nameoptionalstroAuth2CredentialProviderNameoptionalStringOAuth2CredentialProviderNameoptionalstringOAuth2CredentialProviderNameoptional*string #Default: a name generated by CDK
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #Default: no tags