Closed matiboy closed 6 years ago
use result.getIdToken().getJwtToken(); not result.getAccessToken().getJwtToken() I have the same issue and finally find out it just a silly mistake
facing same issue, what is the solution here?
See issue below that might help you debug:
Simply setting the value of result.getIdToken().getJwtToken()
as Authorizer header is working, though that doesn't go through Federated Identity at all.
It shouldn't, the API Gateway Cognito Authorizer is directly integrated with User Pools.
Hi, I'm having problems with using a Cognito Pool Authorizer on API Gateway.
What works:
apigClientFactory.newClient
passing the details from credentials, and the region. I can see the options are saved in the config. Theauth_type
is automatically set to 'AWS_IAM', that should be correct, right?What doesn't work: Now when making a call to an API that is protected by the Cognito authorizer, I get a 401 UnauthorizedException
I've checked the Authorization header, looks something like {code}AWS4-HMAC-SHA256 Credential=ASIAJ2FWUMSYLSBPQL6Q/20171118/us-east-2/execute-api/aws4_request, SignedHeaders=accept;host;x-amz-date, Signature=6bcf047733069.....{code} and put it into the Authorizer Test form (I should put the entire header, not just the signature, right?) and that fails too with 401.
Wondering what I can try in order to find out where the issue , how to "debug" the 401 (is it policy, wrong IdentityPool, etc?)
Thanks!
Mat
Summary of questions: