@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:47.783Z") 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 . |
IAuthorizer.Jsii$Default, IAuthorizer.Jsii$Proxy
IResource.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
TokenAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
TokenAuthorizer(software.amazon.jsii.JsiiObjectRef objRef) |
|
TokenAuthorizer(software.constructs.Construct scope,
java.lang.String id,
TokenAuthorizerProps props) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAuthorizerArn()
The ARN of the authorizer to be used in permission policies, such as IAM and resource-based grants.
|
java.lang.String |
getAuthorizerId()
The id of the authorizer.
|
protected IFunction |
getHandler()
The Lambda function handler that this authorizer uses.
|
protected java.lang.String |
getRestApiId() |
protected IRole |
getRole()
The IAM role that the API Gateway service assumes while invoking the Lambda function.
|
protected java.lang.String |
lazyRestApiId()
Returns a token that resolves to the Rest Api Id at the time of synthesis.
|
protected void |
setRestApiId(java.lang.String value) |
protected void |
setupPermissions()
Sets up the permissions necessary for the API Gateway service to invoke the Lambda function.
|
getAuthorizationType, isAuthorizer
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAuthorizationType
getNode
protected TokenAuthorizer(software.amazon.jsii.JsiiObjectRef objRef)
protected TokenAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public TokenAuthorizer(software.constructs.Construct scope, java.lang.String id, TokenAuthorizerProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.protected java.lang.String lazyRestApiId()
Throws an error, during token resolution, if no RestApi is attached to this authorizer.
protected void setupPermissions()
public java.lang.String getAuthorizerArn()
public java.lang.String getAuthorizerId()
getAuthorizerId
in interface IAuthorizer
getAuthorizerId
in class Authorizer
protected IFunction getHandler()
protected IRole getRole()
protected java.lang.String getRestApiId()
protected void setRestApiId(java.lang.String value)