0
votes

I'm currently building a simple API with AWS API Gateway. I'll use Auth0 for the authentification. I've created a simple lambda function which will deliver some JSON content on a GET request. Without authentication, it's working. So I've created a custom authorizer for the API using a lambda call. Testing only this lambda call with valid token is working. Testing the custom authorizer with token is working and also testing the specific GET request with valid token is working. Now I want to use postman to check the API but there I get an 401. Anybody an idea what could be the problem ? Thanks for your help.

1

1 Answers

3
votes

Initially check Token Source in your API gateway. The value of it should be 'Authorization' not 'method.request.header.Authorization'

If above settings is correct then see how to invoke it from POSTMAN

To call an API with the custom TOKEN authorizer

  • Open Postman, choose the GET method and paste the API's Invoke URL into the adjacent URL field.

Add the custom authorization token header and set the value to allow. Choose Send.

enter image description here

Worth read - http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#call-api-with-api-gateway-custom-authorization