> **Experimental**
>
> `@aws-cdk/aws-bedrock-agentcore-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# RuntimeAuthorizerConfiguration

Abstract base class for runtime authorizer configurations.

Provides static factory methods to create different authentication types.

Obtainable from: RuntimeAuthorizerConfiguration.usingCognito, RuntimeAuthorizerConfiguration.usingIAM, RuntimeAuthorizerConfiguration.usingJWT, RuntimeAuthorizerConfiguration.usingOAuth

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

## 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';
import { aws_cognito as cognito } from 'aws-cdk-lib';

declare const runtimeCustomClaim: bedrock_agentcore_alpha.RuntimeCustomClaim;
declare const userPool: cognito.UserPool;
declare const userPoolClient: cognito.UserPoolClient;
const runtimeAuthorizerConfiguration = bedrock_agentcore_alpha.RuntimeAuthorizerConfiguration.usingCognito(userPool, [userPoolClient], /* all optional props */ ['allowedAudience'], /* all optional props */ ['allowedScopes'], /* all optional props */ [runtimeCustomClaim]);
```

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
from aws_cdk import aws_cognito as cognito

# runtime_custom_claim: bedrock_agentcore_alpha.RuntimeCustomClaim
# user_pool: cognito.UserPool
# user_pool_client: cognito.UserPoolClient

runtime_authorizer_configuration = bedrock_agentcore_alpha.RuntimeAuthorizerConfiguration.using_cognito(user_pool, [user_pool_client], ["allowedAudience"], ["allowedScopes"], [runtime_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.*;
import software.amazon.awscdk.services.cognito.*;

RuntimeCustomClaim runtimeCustomClaim;
UserPool userPool;
UserPoolClient userPoolClient;

RuntimeAuthorizerConfiguration runtimeAuthorizerConfiguration = RuntimeAuthorizerConfiguration.usingCognito(userPool, List.of(userPoolClient), List.of("allowedAudience"), List.of("allowedScopes"), List.of(runtimeCustomClaim));
```

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;
using Amazon.CDK.AWS.Cognito;

RuntimeCustomClaim runtimeCustomClaim;
UserPool userPool;
UserPoolClient userPoolClient;

var runtimeAuthorizerConfiguration = RuntimeAuthorizerConfiguration.UsingCognito(userPool, new [] { userPoolClient }, new [] { "allowedAudience" }, new [] { "allowedScopes" }, new [] { runtimeCustomClaim });
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var runtimeCustomClaim RuntimeCustomClaim
var userPool UserPool
var userPoolClient UserPoolClient

runtimeAuthorizerConfiguration := bedrock_agentcore_alpha.RuntimeAuthorizerConfiguration_UsingCognito(userPool, []IUserPoolClient{
	userPoolClient,
}, []*string{
	jsii.String("allowedAudience"),
}, []*string{
	jsii.String("allowedScopes"),
}, []RuntimeCustomClaim{
	runtimeCustomClaim,
})
```

## Initializer

TypeScript:

```ts
new RuntimeAuthorizerConfiguration()
```

Python:

```python
RuntimeAuthorizerConfiguration()
```

Java:

```java
new RuntimeAuthorizerConfiguration()
```

C# / .NET:

```csharp
new RuntimeAuthorizerConfiguration()
```

Golang:

```go
NewRuntimeAuthorizerConfiguration()
```

## Methods

- `usingCognito(userPool: IUserPool, userPoolClients: IUserPoolClient[], allowedAudience?: string[], allowedScopes?: string[], customClaims?: RuntimeCustomClaim[]): RuntimeAuthorizerConfiguration // chainable` (static) — Use AWS Cognito User Pool authentication.

  Validates Cognito-issued JWT tokens.

  **Parameters**

  - `userPool` — The Cognito User Pool.
  - `userPoolClients` — The Cognito User Pool App Clients.
  - `allowedAudience` — Optional array of allowed audiences.
  - `allowedScopes` — Optional array of allowed scopes.
  - `customClaims` — Optional array of custom claim validations.

  **Returns:** RuntimeAuthorizerConfiguration for Cognito authentication

- `usingIAM(): RuntimeAuthorizerConfiguration // chainable` (static) — Use IAM authentication (default).

  Requires AWS credentials to sign requests using SigV4.

  **Returns:** RuntimeAuthorizerConfiguration for IAM authentication

- `usingJWT(discoveryUrl: string, allowedClients?: string[], allowedAudience?: string[], allowedScopes?: string[], customClaims?: RuntimeCustomClaim[]): RuntimeAuthorizerConfiguration // chainable` (static) — Use custom JWT authentication.

  Validates JWT tokens against the specified OIDC provider.

  **Parameters**

  - `discoveryUrl` — The OIDC discovery URL (must end with /.well-known/openid-configuration).
  - `allowedClients` — Optional array of allowed client IDs.
  - `allowedAudience` — Optional array of allowed audiences.
  - `allowedScopes` — Optional array of allowed scopes.
  - `customClaims` — Optional array of custom claim validations.

  **Returns:** RuntimeAuthorizerConfiguration for JWT authentication

- `usingOAuth(discoveryUrl: string, clientId: string, allowedAudience?: string[], allowedScopes?: string[], customClaims?: RuntimeCustomClaim[]): RuntimeAuthorizerConfiguration // chainable` (static) — Use OAuth 2.0 authentication. Supports various OAuth providers.

  **Parameters**

  - `discoveryUrl` — The OIDC discovery URL (must end with /.well-known/openid-configuration).
  - `clientId` — OAuth client ID.
  - `allowedAudience` — Optional array of allowed audiences.
  - `allowedScopes` — Optional array of allowed scopes.
  - `customClaims` — Optional array of custom claim validations.

  **Returns:** RuntimeAuthorizerConfiguration for OAuth authentication
