# CustomJwtConfiguration

Custom JWT authorizer configuration.

Used as props by: [CustomJwtAuthorizer](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.CustomJwtAuthorizer.html)
Used as argument in: [GatewayAuthorizer.usingCustomJwt](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.GatewayAuthorizer.html#usingcustomjwt)

- Source: [`lib/gateway/inbound-auth/authorizer.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/inbound-auth/authorizer.ts#L47)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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 }
};
```

Golang:

```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

- `allowedAudience`: string[] — Represents individual audience values that are validated in the incoming JWT token validation process.

  **Default:** No audience validation

- `allowedClients`: string[] — Represents individual client IDs that are validated in the incoming JWT token validation process.

  **Default:** No client ID validation

- `allowedScopes`: string[] — Represents individual scopes that are validated in the incoming JWT token validation process.

  **Default:** No scope validation

- `customClaims`: [GatewayCustomClaim](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.GatewayCustomClaim.html)[] — 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.

- `discoveryUrl`: 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
