Interface ITokenAuthorizerProps
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
Properties for TokenAuthorizer.
public interface ITokenAuthorizerProps : ILambdaAuthorizerProps
- Inherited Members
Examples
Function authFn;
Resource books;
var auth = new TokenAuthorizer(this, "booksAuthorizer", new TokenAuthorizerProps {
Handler = authFn
});
books.AddMethod("GET", new HttpIntegration("http://amazon.com"), new MethodOptions {
Authorizer = auth
});
Remarks
ExampleMetadata: infused
Properties
IdentitySource
The request header mapping expression for the bearer token.
string? IdentitySource { get; }
Property Value
Remarks
This is typically passed as part of the header, in which case
this should be method.request.header.Authorizer
where Authorizer is the header containing the bearer token.
Default: IdentitySource.header('Authorization')
See: https://docs.aws.amazon.com/apigateway/api-reference/link-relation/authorizer-create/#identitySource
ValidationRegex
An optional regex to be matched against the authorization token.
string? ValidationRegex { get; }
Property Value
Remarks
When matched the authorizer lambda is invoked, otherwise a 401 Unauthorized is returned to the client.
Default: - no regex filter will be applied.