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:ListIdentitySource:StringJwtConfiguration:Map
Properties
-
List of authorization scopes for this authorizer.
Type: List
Required: No
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.
-
Identity source expression for this authorizer.
Type: String
Required: No
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.
-
JWT configuration for this authorizer.
This is passed through to the
jwtConfigurationsection of anx-amazon-apigateway-authorizerin thesecuritySchemessection of an OpenAPI definition.Note
Properties
issuerandaudienceare case insensitive and can be used either lowercase as in OpenAPI or uppercaseIssuerandAudienceas in AWS::ApiGatewayV2::Authorizer.Type: Map
Required: No
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an 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