Interface ITokenAuthorizerProps
Properties for TokenAuthorizer.
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ITokenAuthorizerProps : ILambdaAuthorizerProps
Syntax (vb)
Public Interface ITokenAuthorizerProps
Inherits ILambdaAuthorizerProps
Remarks
ExampleMetadata: infused
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
});
Synopsis
Properties
IdentitySource | The request header mapping expression for the bearer token. |
ValidationRegex | An optional regex to be matched against the authorization token. |
Properties
IdentitySource
The request header mapping expression for the bearer token.
virtual string IdentitySource { get; }
Property Value
System.String
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.
virtual string ValidationRegex { get; }
Property Value
System.String
Remarks
When matched the authorizer lambda is invoked, otherwise a 401 Unauthorized is returned to the client.
Default: - no regex filter will be applied.