@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.240Z") @Stability(value=Stable) public class TokenAuthorizer extends Authorizer implements IAuthorizer
Based on the token, authorization is performed by a lambda function.
Example:
Function authFn;
Resource books;
TokenAuthorizer auth = TokenAuthorizer.Builder.create(this, "booksAuthorizer")
.handler(authFn)
.build();
books.addMethod("GET", new HttpIntegration("http://amazon.com"), MethodOptions.builder()
.authorizer(auth)
.build());
| Modifier and Type | Class and Description |
|---|---|
static class |
TokenAuthorizer.Builder
A fluent builder for
TokenAuthorizer. |
software.amazon.jsii.JsiiObject.InitializationModeIAuthorizer.Jsii$Default, IAuthorizer.Jsii$ProxyIResource.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
TokenAuthorizer(software.constructs.Construct scope,
String id,
TokenAuthorizerProps props) |
protected |
TokenAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
TokenAuthorizer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthorizerArn()
The ARN of the authorizer to be used in permission policies, such as IAM and resource-based grants.
|
String |
getAuthorizerId()
The id of the authorizer.
|
protected IFunction |
getHandler()
The Lambda function handler that this authorizer uses.
|
protected String |
getRestApiId() |
protected IRole |
getRole()
The IAM role that the API Gateway service assumes while invoking the Lambda function.
|
protected String |
lazyRestApiId()
Returns a token that resolves to the Rest Api Id at the time of synthesis.
|
protected void |
setRestApiId(String value) |
protected void |
setupPermissions()
Sets up the permissions necessary for the API Gateway service to invoke the Lambda function.
|
getAuthorizationType, isAuthorizerapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAuthorizationTypeprotected TokenAuthorizer(software.amazon.jsii.JsiiObjectRef objRef)
protected TokenAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public TokenAuthorizer(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
TokenAuthorizerProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull protected String lazyRestApiId()
Throws an error, during token resolution, if no RestApi is attached to this authorizer.
@Stability(value=Stable) protected void setupPermissions()
@Stability(value=Stable) @NotNull public String getAuthorizerArn()
@Stability(value=Stable) @NotNull public String getAuthorizerId()
getAuthorizerId in interface IAuthorizergetAuthorizerId in class Authorizer@Stability(value=Stable) @NotNull protected IFunction getHandler()
@Stability(value=Stable) @Nullable protected IRole getRole()
@Stability(value=Stable) @Nullable protected String getRestApiId()
@Stability(value=Stable)
protected void setRestApiId(@Nullable
String value)
Copyright © 2022. All rights reserved.