We currently have a .NET Core 3.1 app that uses AWS Cognito to log in - that works all fine.
However, we are struggling to get an access token (JWT) which we can then pass on to a request to a Lambda function. All the guides I find seem are either outdated or missing something crucial.
It would be great if we could get the token automatically but then also retrieve it on demand from user claims or similar. We can then add the Bearer token to the request header calling a Lambda function via the API Gateway.
Below is what I have, but I have two issues:
- It doesn't provided an error if I purposely give it false information. Is this correct?
- I don't know how to get the token from a PageModel so that I can add the token to a header before making a GET request to a Lambda function.