# Problem accessing custom lambda authorizer context

**URL:** <https://forum.serverless.com/t/problem-accessing-custom-lambda-authorizer-context/15916>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [September 11, 2021, 2:33pm UTC](https://forum.serverless.com/t/problem-accessing-custom-lambda-authorizer-context/15916 "2021-09-11T14:33:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drc](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@drc](https://forum.serverless.com/u/drc)\
**Post date:** [September 11, 2021, 2:33pm UTC](https://forum.serverless.com/t/problem-accessing-custom-lambda-authorizer-context/15916/1 "2021-09-11T14:33:28Z")

</div>

I am trying to call the `trialfunction`, have the jwt be verified by the `auth` function, have the `auth` function pass the scopes back through the context to the `trialfunction` , verify the scopes, and return the response of the `trialfunction` . From what I have read, and based on the serverless youtube course I followed, the context should be found in event.requestContext.authorizer. Unfortunately, for me this is not happening. Currently, my `trialfunction` returns ‘no scopes provided’. This is what I get back in the relevant section of the `trialfunction` event object:

I originally posted this on stack overflow, but maybe this community can help more. See full post and code here:

> <https://stackoverflow.com/questions/69138378/problem-accessing-custom-lambda-authorizer-context>

---

<div class="post-metadata">

**Author:** ![DrColza](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/drcolza/32/2838_2.png) [@DrColza](https://forum.serverless.com/u/DrColza)\
**Post date:** [September 14, 2021, 1:20pm UTC](https://forum.serverless.com/t/problem-accessing-custom-lambda-authorizer-context/15916/2 "2021-09-14T13:20:29Z")

</div>

I had a look through your SO post and it seems like you’re doing everything you should be. I’ve been using custom authorizers heavily over the past few years and passing data to functions via the authorzier response too.

My guess is there is a minor error in your auth function code somewhere but I can’t see it.

I take it from seeing your `console.log(authResponse);` line in the `generatePolicy` function that you’re seeing the authResponse object with the scopes in the context?

I’d double check the authorizer is returning what you’re expecting it to be returning then go from there.

For some 3rd party documentation on custom authorizers I’ve found [this article](https://www.alexdebrie.com/posts/lambda-custom-authorizers/) to be an excellent reference.

---

<div class="post-metadata">

**Author:** ![drc](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@drc](https://forum.serverless.com/u/drc)\
**Post date:** [September 14, 2021, 4:35pm UTC](https://forum.serverless.com/t/problem-accessing-custom-lambda-authorizer-context/15916/3 "2021-09-14T16:35:07Z")

</div>

Thanks for taking a look. I managed to get it working, but similarly to the post which I linked to, I don’t know why. Seems like the solution is sleep on it and come back with fresh eyes.
