AWS Custom Lamba Authorizer called twice for single request from client with empty event object second timeAWS API Gateway Custom Authorizer AuthorizerConfigurationExceptionAWS API Gateway Custom Authorizer with Proxy setup - Add Custom Headers to RequestAWS API Gateway custom authorizer. How to access principalId in lambdaAWS API Gateway Security with a Custom Authoriser & AWS Service IntegrationsAccess POST Request body from Custom Authorizer Lambda FunctionPrincipal ID for unauthenticated / guest request, via Lambda custom authorizer?How to write policies for multiple custom authorizers in one API Gateway REST API?How to implement authorization in AWS api gateway using cognito user pools?AWS Custom Authorizer times outIn AWS Api gateway custom authorizer, how to add custom headers to the input request based on validation on headers and send to backend
How do draw effects during the discard phase work?
Why has Marx's "Das Kapital" been translated to "Capital" in English and not "The Capital"
How do I write a vertically-stacked definition of a sequence?
Draw the ☣ (Biohazard Symbol)
Fantasy Military Arms and Armor: the Dwarven Grand Armory
What's this inadvertent thing?
How do German speakers decide what should be on the left side of the verb?
How many attacks exactly do I get combining Dual Wielder feat with Two-Weapon Fighting style?
Why did Boris Johnson call for new elections?
Let A,B,C be sets. If A△B=A△C, does this imply that B=C?
Why are some hotels asking you to book through Booking.com instead of matching the price at the front desk?
Is future tense in English really a myth?
The Green Glass Door, Revisited
Can taking my 1-week-old on a 6-7 hours journey in the car lead to medical complications?
Was Rosie the Riveter sourced from a Michelangelo painting?
When does order matter in probability?
Why do we buy the Mazur Swindle in knot theory?
Project Euler problem #112
Does the word voltage exist in academic engineering?
More than three domains hosted on the same IP address
What makes an ending "happy"?
Should I tip on the Amtrak train?
If every star in the universe except the Sun were destroyed, would we die?
Dissuading my girlfriend from a scam
AWS Custom Lamba Authorizer called twice for single request from client with empty event object second time
AWS API Gateway Custom Authorizer AuthorizerConfigurationExceptionAWS API Gateway Custom Authorizer with Proxy setup - Add Custom Headers to RequestAWS API Gateway custom authorizer. How to access principalId in lambdaAWS API Gateway Security with a Custom Authoriser & AWS Service IntegrationsAccess POST Request body from Custom Authorizer Lambda FunctionPrincipal ID for unauthenticated / guest request, via Lambda custom authorizer?How to write policies for multiple custom authorizers in one API Gateway REST API?How to implement authorization in AWS api gateway using cognito user pools?AWS Custom Authorizer times outIn AWS Api gateway custom authorizer, how to add custom headers to the input request based on validation on headers and send to backend
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have configured a custom lambda authorizer of REQUEST type. I have added 4 new custom request headers as Identity source at API --> Authorizers --> Identity Sources and 1 default Authorization. So in total there are 5.
When I make a call to the API which has the above authorizer configured, the authorizer is being called twice. First time with values to all parameters in the event object second time with empty event object.
Since event object is null, my code is throwing null pointer even though first time validated claims successfully and returned Allow policy.
Initially I tried with token type authorizer but token alone itself was not enough for me to verify. Token type works just fine. I.e. there is no 2nd request made.
When I moved to REQUEST type I started seeing this issue.
Below are logs from cloudwatch
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad DEBUG APIGatewayLambdaAuthorizer:92 - Sucess: Request authorized
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad TRACE APIGatewayLambdaAuthorizer:103 - Exit: Policy generated: policyDocument=Version=2012-10-17, Statement=[Action=execute-api:Invoke, Resource=arn:aws:execute-api:us-east-2:851424344156:67w9c9wojb/stage/GET/, Effect=Allow], principalId=yC98Q4Edda9QqwYVkkhe75sUR8SS25pK@clients
2019-03-28 05:53:33 090465d8-2c04-4869-83fb-cdcde53d33b7 TRACE APIGatewayLambdaAuthorizer:82 - Enter event:
, context: lambdainternal.api.LambdaContext@4c5474f5
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
amazon-web-services aws-api-gateway auth0 lambda-authorizer
add a comment |
I have configured a custom lambda authorizer of REQUEST type. I have added 4 new custom request headers as Identity source at API --> Authorizers --> Identity Sources and 1 default Authorization. So in total there are 5.
When I make a call to the API which has the above authorizer configured, the authorizer is being called twice. First time with values to all parameters in the event object second time with empty event object.
Since event object is null, my code is throwing null pointer even though first time validated claims successfully and returned Allow policy.
Initially I tried with token type authorizer but token alone itself was not enough for me to verify. Token type works just fine. I.e. there is no 2nd request made.
When I moved to REQUEST type I started seeing this issue.
Below are logs from cloudwatch
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad DEBUG APIGatewayLambdaAuthorizer:92 - Sucess: Request authorized
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad TRACE APIGatewayLambdaAuthorizer:103 - Exit: Policy generated: policyDocument=Version=2012-10-17, Statement=[Action=execute-api:Invoke, Resource=arn:aws:execute-api:us-east-2:851424344156:67w9c9wojb/stage/GET/, Effect=Allow], principalId=yC98Q4Edda9QqwYVkkhe75sUR8SS25pK@clients
2019-03-28 05:53:33 090465d8-2c04-4869-83fb-cdcde53d33b7 TRACE APIGatewayLambdaAuthorizer:82 - Enter event:
, context: lambdainternal.api.LambdaContext@4c5474f5
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
amazon-web-services aws-api-gateway auth0 lambda-authorizer
add a comment |
I have configured a custom lambda authorizer of REQUEST type. I have added 4 new custom request headers as Identity source at API --> Authorizers --> Identity Sources and 1 default Authorization. So in total there are 5.
When I make a call to the API which has the above authorizer configured, the authorizer is being called twice. First time with values to all parameters in the event object second time with empty event object.
Since event object is null, my code is throwing null pointer even though first time validated claims successfully and returned Allow policy.
Initially I tried with token type authorizer but token alone itself was not enough for me to verify. Token type works just fine. I.e. there is no 2nd request made.
When I moved to REQUEST type I started seeing this issue.
Below are logs from cloudwatch
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad DEBUG APIGatewayLambdaAuthorizer:92 - Sucess: Request authorized
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad TRACE APIGatewayLambdaAuthorizer:103 - Exit: Policy generated: policyDocument=Version=2012-10-17, Statement=[Action=execute-api:Invoke, Resource=arn:aws:execute-api:us-east-2:851424344156:67w9c9wojb/stage/GET/, Effect=Allow], principalId=yC98Q4Edda9QqwYVkkhe75sUR8SS25pK@clients
2019-03-28 05:53:33 090465d8-2c04-4869-83fb-cdcde53d33b7 TRACE APIGatewayLambdaAuthorizer:82 - Enter event:
, context: lambdainternal.api.LambdaContext@4c5474f5
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
amazon-web-services aws-api-gateway auth0 lambda-authorizer
I have configured a custom lambda authorizer of REQUEST type. I have added 4 new custom request headers as Identity source at API --> Authorizers --> Identity Sources and 1 default Authorization. So in total there are 5.
When I make a call to the API which has the above authorizer configured, the authorizer is being called twice. First time with values to all parameters in the event object second time with empty event object.
Since event object is null, my code is throwing null pointer even though first time validated claims successfully and returned Allow policy.
Initially I tried with token type authorizer but token alone itself was not enough for me to verify. Token type works just fine. I.e. there is no 2nd request made.
When I moved to REQUEST type I started seeing this issue.
Below are logs from cloudwatch
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad DEBUG APIGatewayLambdaAuthorizer:92 - Sucess: Request authorized
2019-03-28 05:53:33 b78955e6-c072-4ada-945f-c8d34490d2ad TRACE APIGatewayLambdaAuthorizer:103 - Exit: Policy generated: policyDocument=Version=2012-10-17, Statement=[Action=execute-api:Invoke, Resource=arn:aws:execute-api:us-east-2:851424344156:67w9c9wojb/stage/GET/, Effect=Allow], principalId=yC98Q4Edda9QqwYVkkhe75sUR8SS25pK@clients
2019-03-28 05:53:33 090465d8-2c04-4869-83fb-cdcde53d33b7 TRACE APIGatewayLambdaAuthorizer:82 - Enter event:
, context: lambdainternal.api.LambdaContext@4c5474f5
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
amazon-web-services aws-api-gateway auth0 lambda-authorizer
amazon-web-services aws-api-gateway auth0 lambda-authorizer
asked Mar 28 at 6:11
user1576882user1576882
651 gold badge3 silver badges12 bronze badges
651 gold badge3 silver badges12 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I really do not know what was the issue. So re-created a new lambda authorizer of request type and it is working fine :(
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391143%2faws-custom-lamba-authorizer-called-twice-for-single-request-from-client-with-emp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I really do not know what was the issue. So re-created a new lambda authorizer of request type and it is working fine :(
add a comment |
I really do not know what was the issue. So re-created a new lambda authorizer of request type and it is working fine :(
add a comment |
I really do not know what was the issue. So re-created a new lambda authorizer of request type and it is working fine :(
I really do not know what was the issue. So re-created a new lambda authorizer of request type and it is working fine :(
answered Mar 28 at 12:05
user1576882user1576882
651 gold badge3 silver badges12 bronze badges
651 gold badge3 silver badges12 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391143%2faws-custom-lamba-authorizer-called-twice-for-single-request-from-client-with-emp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown