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
Description
I am not able to set IdentitySource for
REQUESTAuthorizer in SAM.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:
Could this check be removed?
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
IdentitySourceproperty and applies it in the cloud.Additional environment details
sam --version: