OAuth2Authorizer
Definition for an OAuth 2.0 authorizer, also known to as a JSON Web Token (JWT) authorizer.
For more information, see Controlling access to HTTP APIs with JWT authorizers in the API Gateway Developer Guide.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
AuthorizationScopes:
List
IdentitySource:String
JwtConfiguration:Map
Properties
-
List of authorization scopes for this authorizer.
Type: List
Required: No
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.
-
Identity source expression for this authorizer.
Type: String
Required: No
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.
-
JWT configuration for this authorizer.
This is passed through to the
jwtConfiguration
section of anx-amazon-apigateway-authorizer
in thesecuritySchemes
section of an OpenAPI definition.Note
Properties
issuer
andaudience
are case insensitive and can be used either lowercase as in OpenAPI or uppercaseIssuer
andAudience
as in AWS::ApiGatewayV2::Authorizer.Type: Map
Required: No
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.
Examples
OAuth 2.0 authorizer
OAuth 2.0 authorizer Example
YAML
Auth: Authorizers: OAuth2Authorizer: AuthorizationScopes: - scope1 JwtConfiguration: issuer: "https://www.example.com/v1/connect/oauth2" audience: - MyApi IdentitySource: "$request.querystring.param" DefaultAuthorizer: OAuth2Authorizer