# CustomJwtAuthorizer

Custom JWT authorizer configuration implementation.

Implements: [IGatewayAuthorizerConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.IGatewayAuthorizerConfig.html)

- 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#L87)

## 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 customJwtAuthorizer = new bedrock_agentcore_alpha.CustomJwtAuthorizer({
  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_authorizer = bedrock_agentcore_alpha.CustomJwtAuthorizer(
    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;

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

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 customJwtAuthorizer = new CustomJwtAuthorizer(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

customJwtAuthorizer := bedrock_agentcore_alpha.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

TypeScript:

```ts
new CustomJwtAuthorizer(config: CustomJwtConfiguration)
```

Python:

```python
CustomJwtAuthorizer(config: CustomJwtConfiguration)
```

Java:

```java
new CustomJwtAuthorizer(CustomJwtConfiguration config)
```

C# / .NET:

```csharp
new CustomJwtAuthorizer(CustomJwtConfiguration config)
```

Golang:

```go
NewCustomJwtAuthorizer(Config CustomJwtConfiguration)
```

## Properties

- `authorizerType`: [GatewayAuthorizerType](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.GatewayAuthorizerType.html) — The authorizer type.
