# IdentitySource

Represents an identity source.

The source can be specified either as a literal value (e.g: `Auth`) which
cannot be blank, or as an unresolved string token.

- Source: [`aws-apigateway/lib/authorizers/identity-source.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/identity-source.ts#L10)

## Example

```ts
declare const authFn: lambda.Function;
declare const books: apigateway.Resource;

const auth = new apigateway.RequestAuthorizer(this, 'booksAuthorizer', {
  handler: authFn,
  identitySources: [apigateway.IdentitySource.header('Authorization')]
});

books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
  authorizer: auth
});
```

## Initializer

```ts
new IdentitySource()
```

## Methods

- `context(context: string): string` (static) — Provides a properly formatted request context identity source.

  **Parameters**

  - `context` — the name of the context variable the `IdentitySource` will represent.

  **Returns:** a request context identity source.

- `header(headerName: string): string` (static) — Provides a properly formatted header identity source.

  **Parameters**

  - `headerName` — the name of the header the `IdentitySource` will represent.

  **Returns:** a header identity source.

- `queryString(queryString: string): string` (static) — Provides a properly formatted query string identity source.

  **Parameters**

  - `queryString` — the name of the query string the `IdentitySource` will represent.

  **Returns:** a query string identity source.

- `stageVariable(stageVariable: string): string` (static) — Provides a properly formatted API Gateway stage variable identity source.

  **Parameters**

  - `stageVariable` — the name of the stage variable the `IdentitySource` will represent.

  **Returns:** an API Gateway stage variable identity source.
