Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Custom Authorizer Lambda Request context missing accountId and apiId fields #1640

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

rfranco
Copy link
Contributor

@rfranco rfranco commented Jan 3, 2023

Description

Prior to #1600 change, APIGatewayEvent.requestContext object available in custom authorizer lambda had accountId and apiId fields. We used these fields construct methodArn inside our authorizer lambda. But the above change deleted these fields. Any reason why the fields are removed? AWS Lambda https://github.com/types still refer to these fields.

Fixed: #1635

@closesimple-mf
Copy link

Thank you, this fixed our issue so that serverless-offline worked again with our custom authorizer after upgrading.

@dherault could this be merged? This fixes #1475 for us

@nbenoit3
Copy link

nbenoit3 commented Jan 9, 2024

@dherault Hello, is there any way this PR can be merged in? Currently running into this issue as well.

@dnalborczyk dnalborczyk changed the title fix Custom Authorizer Lambda Request context missing accountId and apiId fields fix: Custom Authorizer Lambda Request context missing accountId and apiId fields Jan 9, 2024
@dnalborczyk dnalborczyk merged commit 3a5fca9 into dherault:master Jan 9, 2024
@dnalborczyk
Copy link
Collaborator

thank you @rfranco

@celadari
Copy link

Thank you, this fixed our issue so that serverless-offline worked again with our custom authorizer after upgrading.

@dherault could this be merged? This fixes #1475 for us

Hi @closesimple-mf , can you share with me the code that works on your end ?

If I try

return {
            isAuthorized: true,
        };

in my lambda authorizer function I still get the error

Authorization response did not include a principalId

@SeanHaleAtPI
Copy link

I am also experiencing the same issue as @celadari . @closesimple-mf WOuld you mind sharing your solution as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Authorizer Lambda Request context missing accountId and apiId fields
6 participants