You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for reading this issue, the scenario is below.
User send a request by jwt.Token belong to Cogntio User Pool to API Gateway which is authorized but cannot recognize the request belonge to which user.
The "events.APIGatewayProxyResponse" doesn't provide information by default like there openId, email, etc.
How could I recognize user by Authorize token?
The text was updated successfully, but these errors were encountered:
As you know, in the payload of the AWS Lambda event there isn't much data about who exactly was trying to get some resource from your API while identifying via Authorization header. Thanks to that "feature" Lambda "acts" universally. And that is great, because you are not not obliged to use AWS Cognito service in your authorizer (not very tight vendor lock-in I'd say).
Please note: There are few ways to authenticate and/or authorize user in API Gateway, such as:
Authorizer with Type: "COGNITO_USER_POOLS", extracting claims in the Lambda handler.
Custom Lambda authorizers with Type: "REQUEST" or Type: "TOKEN", i.e. which will extract interesting claims from JWT and pass them further in the request context - follow instruction on AWS Knowledge Center.
Handling authorization directly in the Lambda handler - a.b.
Authentication based on API Keys generated by API Gateway.
Authentication based on AWS Credentials.
In case of scenario 1.: You have a lot of information about identity in events.APIGatewayRequestIdentity. If you need some extra information, then it you may try to parse the JWT token (Authorization header) with disabled validation (to do not do it twice) and extract claims as a map.
Thank you for reading this issue, the scenario is below.
User send a request by jwt.Token belong to Cogntio User Pool to API Gateway which is authorized but cannot recognize the request belonge to which user.
The "events.APIGatewayProxyResponse" doesn't provide information by default like there openId, email, etc.
How could I recognize user by Authorize token?
The text was updated successfully, but these errors were encountered: