Skip to content
v2.274.0

CustomJwtAuthorizer Class ​

Custom JWT authorizer configuration implementation.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';

declare const gatewayCustomClaim: bedrockagentcore.GatewayCustomClaim;
const customJwtAuthorizer = new bedrockagentcore.CustomJwtAuthorizer({
  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.
from aws_cdk import aws_bedrockagentcore as bedrockagentcore

# gateway_custom_claim: bedrockagentcore.GatewayCustomClaim

custom_jwt_authorizer = bedrockagentcore.CustomJwtAuthorizer(
    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.bedrockagentcore.*;

GatewayCustomClaim gatewayCustomClaim;

CustomJwtAuthorizer customJwtAuthorizer = CustomJwtAuthorizer.Builder.create()
        .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.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.BedrockAgentCore;

GatewayCustomClaim gatewayCustomClaim;

var customJwtAuthorizer = new CustomJwtAuthorizer(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/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var gatewayCustomClaim GatewayCustomClaim

customJwtAuthorizer := awscdk.Aws_bedrockagentcore.NewCustomJwtAuthorizer(&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,
	},
})

Initializer ​

ts
new CustomJwtAuthorizer(config: CustomJwtConfiguration)
python
CustomJwtAuthorizer(config: CustomJwtConfiguration)
java
new CustomJwtAuthorizer(CustomJwtConfiguration config)
csharp
new CustomJwtAuthorizer(CustomJwtConfiguration config)
go
NewCustomJwtAuthorizer(Config CustomJwtConfiguration)

Properties ​

authorizerTypeGatewayAuthorizerTypeauthorizer_typeGatewayAuthorizerTypeauthorizerTypeGatewayAuthorizerTypeAuthorizerTypeGatewayAuthorizerTypeAuthorizerTypeGatewayAuthorizerTyperequired#
The authorizer type.