# Lambda Custom Authorizer - Error: Auth0 empty return

**URL:** <https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309>\
**Category:** JWT.io\
**Tags:** lambda, auth0\
**Created:** [May 2, 2018, 11:14am UTC](https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309 "2018-05-02T11:14:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bror](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bror/32/4797_2.png) [@bror](https://community.auth0.com/u/bror)\
**Post date:** [May 2, 2018, 11:14am UTC](https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309/1 "2018-05-02T11:14:07Z")

</div>

I have built an AWS Lambda custom authorizer based on: [GitHub - auth0-samples/jwt-rsa-aws-custom-authorizer: An AWS Custom Authorizer for AWS Gateway that support Auth0 Bearer tokens. · GitHub](https://github.com/auth0-samples/jwt-rsa-aws-custom-authorizer). It works locally, but when I test run the Lambda after upload to AWS I get this error:

START RequestId: eef86a3c-4da5-11e8-a0d1-5bb90554b6ee Version: $LATEST  
2018-05-02T01:12:51.036Z eef86a3c-4da5-11e8-a0d1-5bb90554b6ee { type: ‘TOKEN’,  
authorizationToken: ‘Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5VSTJORFE1UlVNM1JqVTRPVUZETUVVMFEwUkZRemN3TVRaRlFqUkZNRU13UlRRek1qSTFNUSJ9.eyJpc3MiOiJodHRwczovL2lwcm9nbm9zLmF1dGgwLmNvbS8iLCJzdWIiOiIyRWpnTEpWTHo3dWM0eG5CRjVWbTRqcm5VbzN5Rlo3WEBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9hcGkuaXByb2dub3MuY29tLyIsImlhdCI6MTUyNTIyMzQyMywiZXhwIjoxNTI1MzA5ODIzLCJhenAiOiIyRWpnTEpWTHo3dWM0eG5CRjVWbTRqcm5VbzN5Rlo3WCIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.dJ4ibbPsoES1ZjSJmaOqsR9c5b3Zu9LGCdrq9MRYlgDFYsEnCaCSnOaWRYDYi3bLYbnzD2Qkvo4VSKuk0TeC2dJlvmI2b1SpFMSzVTv6QrFRWPVxT2UsQZYaPdQc9W88tN3xzv8R5WjGrBh6mS9yHJwbAcph6a0yYzclXwLHloIncca9sLl0Gb7NLPsYdJvuDmZCuZqDijluZ-TVGQ24ffYLDYxnua1NqkOlP4BubrBIA6d6v5cYC-VBlXqBJR8SY4GIQxaCeEsWLhno5VuMasUoALEW4T\_BbeXvK\_MbxB9yarKQl\_1SQ0BhNXYoagw\_n6ihmzmdzZ-tqatIXNhLfg’,  
methodArn: ‘arn:aws:execute-api:us-east-1:617232781270:apiId/stage/method/resourcePath’ }  
2018-05-02T01:12:52.855Z eef86a3c-4da5-11e8-a0d1-5bb90554b6ee Data: [object Object]  
2018-05-02T01:12:52.877Z eef86a3c-4da5-11e8-a0d1-5bb90554b6ee Error: Auth0 empty return  
at returnAuth0UserInfo (/var/task/index.js:18:32)  
at /var/task/index.js:27:1  
at /var/task/lib.js:70:21  
at /var/task/node\_modules/jsonwebtoken/verify.js:27:18  
at nextTickCallbackWith0Args (node.js:415:9)  
at process.\_tickDomainCallback (node.js:385:13)  
END RequestId: eef86a3c-4da5-11e8-a0d1-5bb90554b6ee  
REPORT RequestId: eef86a3c-4da5-11e8-a0d1-5bb90554b6ee Duration: 1956.08 ms Billed Duration: 2000 ms Memory Size: 128 MB Max Memory Used: 45 MB  
RequestId: eef86a3c-4da5-11e8-a0d1-5bb90554b6ee Process exited before completing request

So for some reason I get Error: Auth0 empty

Any advice on this?

---

<div class="post-metadata">

**Author:** ![bror](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bror/32/4797_2.png) [@bror](https://community.auth0.com/u/bror)\
**Post date:** [May 2, 2018, 11:56am UTC](https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309/2 "2018-05-02T11:56:22Z")

</div>

I have both double and triple tested it locally:

npm test

> lambda-auth0-authenticator@0.0.2 test /Users/goransvensson/ics/jwt-rsa-aws-custom-authorizer  
> lambda-local --timeout 300 --lambdapath index.js --eventpath event.json

## Logs

START RequestId: 95903395-1d5a-dede-555d-97a8b847f8fb  
{ type: ‘TOKEN’,  
authorizationToken: ‘Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5VSTJORFE1UlVNM1JqVTRPVUZETUVVMFEwUkZRemN3TVRaRlFqUkZNRU13UlRRek1qSTFNUSJ9.eyJpc3MiOiJodHRwczovL2lwcm9nbm9zLmF1dGgwLmNvbS8iLCJzdWIiOiIyRWpnTEpWTHo3dWM0eG5CRjVWbTRqcm5VbzN5Rlo3WEBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9hcGkuaXByb2dub3MuY29tLyIsImlhdCI6MTUyNTIyMzQyMywiZXhwIjoxNTI1MzA5ODIzLCJhenAiOiIyRWpnTEpWTHo3dWM0eG5CRjVWbTRqcm5VbzN5Rlo3WCIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.dJ4ibbPsoES1ZjSJmaOqsR9c5b3Zu9LGCdrq9MRYlgDFYsEnCaCSnOaWRYDYi3bLYbnzD2Qkvo4VSKuk0TeC2dJlvmI2b1SpFMSzVTv6QrFRWPVxT2UsQZYaPdQc9W88tN3xzv8R5WjGrBh6mS9yHJwbAcph6a0yYzclXwLHloIncca9sLl0Gb7NLPsYdJvuDmZCuZqDijluZ-TVGQ24ffYLDYxnua1NqkOlP4BubrBIA6d6v5cYC-VBlXqBJR8SY4GIQxaCeEsWLhno5VuMasUoALEW4T\_BbeXvK\_MbxB9yarKQl\_1SQ0BhNXYoagw\_n6ihmzmdzZ-tqatIXNhLfg’,  
methodArn: ‘arn:aws:execute-api:us-east-1:617232781270:apiId/stage/method/resourcePath’ }  
END

## Message

{  
“principalId”: “2EjgLJVLz7uc4xnBF5Vm4jrnUo3yFZ7X@clients”,  
“policyDocument”: {  
“Version”: “2012-10-17”,  
“Statement”: [  
{  
“Action”: “execute-api:Invoke”,  
“Effect”: “Allow”,  
“Resource”: “arn:aws:execute-api:us-east-1:617232781270:apiId/stage/method/resourcePath”  
}  
]  
},  
“context”: {}  
}

---

<div class="post-metadata">

**Author:** ![bror](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bror/32/4797_2.png) [@bror](https://community.auth0.com/u/bror)\
**Post date:** [May 2, 2018, 1:22pm UTC](https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309/3 "2018-05-02T13:22:51Z")

</div>

I have followed the Auth0 AWS API Gateway tutorial for custom authorizers: [Secure AWS API Gateway Endpoints Using Custom Authorizers](https://auth0.com/docs/integrations/aws-api-gateway/custom-authorizers/part-1)

---

<div class="post-metadata">

**Author:** ![bror](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bror/32/4797_2.png) [@bror](https://community.auth0.com/u/bror)\
**Post date:** [May 2, 2018, 4:00pm UTC](https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309/4 "2018-05-02T16:00:00Z")

</div>

Ok, I solved it but not by using Auth0 tutorials and sample code. I will post an extensive article on Patreon on how to build an Custom Authorizer! This booth took lots of time, frustration and incrured AWS billing.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 25, 2019, 1:03pm UTC](https://community.auth0.com/t/lambda-custom-authorizer-error-auth0-empty-return/11309/5 "2019-07-25T13:03:20Z")

</div>


