Skip to content
v2.278.0

CustomJwtConfiguration Struct ​

Custom JWT authorizer configuration.

Example ​

ts
// 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';

declare const gatewayCustomClaim: bedrock_agentcore_alpha.GatewayCustomClaim;
const customJwtConfiguration: bedrock_agentcore_alpha.CustomJwtConfiguration = {
  discoveryUrl: 'discoveryUrl',

  // the properties below are optional
  allowedAudience: ['allowedAudience'],
  allowedClients: ['allowedClients'],
  allowedScopes: ['allowedScopes'],
  customClaims: [gatewayCustomClaim],
};
python
# 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

# gateway_custom_claim: bedrock_agentcore_alpha.GatewayCustomClaim

custom_jwt_configuration = bedrock_agentcore_alpha.CustomJwtConfiguration(
    discovery_url="discoveryUrl",

    # the properties below are optional
    allowed_audience=["allowedAudience"],
    allowed_clients=["allowedClients"],
    allowed_scopes=["allowedScopes"],
    custom_claims=[gateway_custom_claim]
)
java
// 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.*;

GatewayCustomClaim gatewayCustomClaim;

CustomJwtConfiguration customJwtConfiguration = CustomJwtConfiguration.builder()
        .discoveryUrl("discoveryUrl")

        // the properties below are optional
        .allowedAudience(List.of("allowedAudience"))
        .allowedClients(List.of("allowedClients"))
        .allowedScopes(List.of("allowedScopes"))
        .customClaims(List.of(gatewayCustomClaim))
        .build();
csharp
// 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;

GatewayCustomClaim gatewayCustomClaim;

var customJwtConfiguration = new CustomJwtConfiguration {
    DiscoveryUrl = "discoveryUrl",

    // the properties below are optional
    AllowedAudience = new [] { "allowedAudience" },
    AllowedClients = new [] { "allowedClients" },
    AllowedScopes = new [] { "allowedScopes" },
    CustomClaims = new [] { gatewayCustomClaim }
};
go
// 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"

var gatewayCustomClaim GatewayCustomClaim

customJwtConfiguration := &CustomJwtConfiguration{
	DiscoveryUrl: jsii.String("discoveryUrl"),

	// the properties below are optional
	AllowedAudience: []*string{
		jsii.String("allowedAudience"),
	},
	AllowedClients: []*string{
		jsii.String("allowedClients"),
	},
	AllowedScopes: []*string{
		jsii.String("allowedScopes"),
	},
	CustomClaims: []GatewayCustomClaim{
		gatewayCustomClaim,
	},
}

Properties ​

allowedAudienceoptionalstring[]allowed_audienceoptionaltyping.List[str]allowedAudienceoptionalList<String>AllowedAudienceoptionalstring[]AllowedAudienceoptional*[]*string #
Represents individual audience values that are validated in the incoming JWT token validation process.

Default: No audience validation

allowedClientsoptionalstring[]allowed_clientsoptionaltyping.List[str]allowedClientsoptionalList<String>AllowedClientsoptionalstring[]AllowedClientsoptional*[]*string #
Represents individual client IDs that are validated in the incoming JWT token validation process.

Default: No client ID validation

allowedScopesoptionalstring[]allowed_scopesoptionaltyping.List[str]allowedScopesoptionalList<String>AllowedScopesoptionalstring[]AllowedScopesoptional*[]*string #
Represents individual scopes that are validated in the incoming JWT token validation process.

Default: No scope validation

customClaimsoptionalGatewayCustomClaim[]custom_claimsoptionaltyping.List[GatewayCustomClaim]customClaimsoptionalList<GatewayCustomClaim>CustomClaimsoptionalGatewayCustomClaim[]CustomClaimsoptional*[]GatewayCustomClaim #
Custom claims for additional JWT token validation.

Default: No custom claim validation

Allows you to validate additional fields in JWT tokens beyond the standard audience, client, and scope validations.

discoveryUrlstringdiscovery_urlstrdiscoveryUrlStringDiscoveryUrlstringDiscoveryUrl*string required #
This URL is used to fetch OpenID Connect configuration or authorization server metadata for validating incoming tokens.

Pattern: .+/.well-known/openid-configuration Required: Yes