# WebSocketAuthorizerProps

Properties to initialize an instance of `WebSocketAuthorizer`.

Used as props by: [WebSocketAuthorizer](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketAuthorizer.html)

- Source: [`aws-apigatewayv2/lib/websocket/authorizer.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/authorizer.ts#L27)
- Type last changed: v2.112.0 · 1 Dec 2023

## Example

TypeScript:

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

declare const webSocketApi: apigatewayv2.WebSocketApi;
const webSocketAuthorizerProps: apigatewayv2.WebSocketAuthorizerProps = {
  identitySource: ['identitySource'],
  type: apigatewayv2.WebSocketAuthorizerType.LAMBDA,
  webSocketApi: webSocketApi,

  // the properties below are optional
  authorizerName: 'authorizerName',
  authorizerUri: 'authorizerUri',
};
```

Python:

```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_apigatewayv2 as apigatewayv2

# web_socket_api: apigatewayv2.WebSocketApi

web_socket_authorizer_props = apigatewayv2.WebSocketAuthorizerProps(
    identity_source=["identitySource"],
    type=apigatewayv2.WebSocketAuthorizerType.LAMBDA,
    web_socket_api=web_socket_api,

    # the properties below are optional
    authorizer_name="authorizerName",
    authorizer_uri="authorizerUri"
)
```

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.apigatewayv2.*;

WebSocketApi webSocketApi;

WebSocketAuthorizerProps webSocketAuthorizerProps = WebSocketAuthorizerProps.builder()
        .identitySource(List.of("identitySource"))
        .type(WebSocketAuthorizerType.LAMBDA)
        .webSocketApi(webSocketApi)

        // the properties below are optional
        .authorizerName("authorizerName")
        .authorizerUri("authorizerUri")
        .build();
```

C# / .NET:

```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.Apigatewayv2;

WebSocketApi webSocketApi;

var webSocketAuthorizerProps = new WebSocketAuthorizerProps {
    IdentitySource = new [] { "identitySource" },
    Type = WebSocketAuthorizerType.LAMBDA,
    WebSocketApi = webSocketApi,

    // the properties below are optional
    AuthorizerName = "authorizerName",
    AuthorizerUri = "authorizerUri"
};
```

Golang:

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

webSocketAuthorizerProps := &WebSocketAuthorizerProps{
	IdentitySource: []*string{
		jsii.String("identitySource"),
	},
	Type: awscdk.Aws_apigatewayv2.WebSocketAuthorizerType_LAMBDA,
	WebSocketApi: webSocketApi,

	// the properties below are optional
	AuthorizerName: jsii.String("authorizerName"),
	AuthorizerUri: jsii.String("authorizerUri"),
}
```

## Properties

- `authorizerName`: string — Name of the authorizer.

  **Default:** id of the WebSocketAuthorizer construct.

- `authorizerUri`: string — The authorizer's Uniform Resource Identifier (URI).

  **Default:** required for Request authorizer types

  For REQUEST authorizers, this must be a well-formed Lambda function URI.

- `identitySource`: string[] (required) — The identity source for which authorization is requested.

- `type`: [WebSocketAuthorizerType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketAuthorizerType.html) (required) — The type of authorizer.

- `webSocketApi`: [IWebSocketApi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IWebSocketApi.html) (required) — WebSocket Api to attach the authorizer to.
