-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Bug: "IdentitySource must be defined only for OAuth2 Authorizer." #3817
Copy link
Copy link
Open
Labels
contributors/good-first-issueGood first issue for a contributorGood first issue for a contributorcontributors/welcomeContributors are welcome to work on thisContributors are welcome to work on this
Description
Description
I am not able to set IdentitySource for REQUEST Authorizer in SAM.
Auth:
Authorizers:
MyAuthorizer:
AuthorizerPayloadFormatVersion: "2.0"
EnableSimpleResponses: true
AuthorizerResultTtlInSeconds: 300
AuthorizerType: REQUEST
IdentitySource:
- $request.header.someheader
FunctionArn: ...
I get the following error: "IdentitySource must be defined only for OAuth2 Authorizer."
What is odd to me that when I set the field in AWS Dashboard and pull the configuration, the property is there:
"Items": [
{
"AuthorizerId": ...
"AuthorizerPayloadFormatVersion": "2.0",
"AuthorizerType": "REQUEST",
"AuthorizerUri": ...,
"EnableSimpleResponses": true,
"IdentitySource": [
"$request.header.someheader"
],
"Name": ...
}
]
Could this check be removed?
if self.id_source is not None and not authorizer_type == "JWT":
raise InvalidResourceException(
self.api_logical_id, "IdentitySource must be defined only for OAuth2 Authorizer."
)
Steps to reproduce
Create a REQUEST authorizer with explicitly set identity source as explained above.
Observed result
It will fail with "IdentitySource must be defined only for OAuth2 Authorizer."
Expected result
It accepts the IdentitySource property and applies it in the cloud.
Additional environment details
- OS: Ubtuntu
- If using the SAM CLI,
sam --version: - AWS region: us-east-1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
contributors/good-first-issueGood first issue for a contributorGood first issue for a contributorcontributors/welcomeContributors are welcome to work on thisContributors are welcome to work on this