InvalidLambdaResponseException - Unrecognizable lambda output when sign in without password with amplifyAWS Cognito User Pool without a passwordIs there a way to cache GitHub credentials for pushing commits?Unrecognizable Lambda Output CognitoCognito auth flow fails with “Already found an entry for username Facebook_10155611263153532”AWS Cognito username/email login is case-sensitivePasswordless Cognito with SMS MFAAWS Cognito: Is there a way to provide Security token for scoped down IAM roles using Cognito?Cognito / Flask / React: how to log into backend?Unrecognized Verify Auth Challenge Lambda response C#AWS Cognito lambda triggers twiceContinue with custom auth flow after NEW_PASSWORD_REQUIRED challenge is answered in AWS Cognito

Does a hash function have a Upper bound on input length?

Project Euler # 25 The 1000 digit Fibonacci index

I want light controlled by one switch, not two

Inscriptio Labyrinthica

Transistor power dissipation rating

What is a Kravchuk transform and how is it related to Fourier transforms?

What's the largest an Earth-like planet can be and support Earth's biosphere?

Get Chord Name From a Given Set of Notes

What are my hardware upgrade optoins for a late 2009 iMac?

Why is this guy handcuffed censored?

Deleting a point in METAFONT

Function over a list that depends on the index

What could make large expeditions ineffective for exploring territory full of dangers and valuable resources?

Will copper pour help on my single-layer PCB?

Improving an O(N^2) function (all entities iterating over all other entities)

Why is the Intel 8086 CPU called a 16-bit CPU?

How to tell readers that I know my story is factually incorrect?

How important are the Author's mood and feelings for writing a story?

Formating slide

A "Replace" sort problem. Basic but haunts me

Authorship dispute on a paper that came out of a final report of a course?

Do higher dimensions have axes?

Simplest instruction set that has an c++/C compiler to write an emulator for?

Was demon possession only a New Testament phenomenon?



InvalidLambdaResponseException - Unrecognizable lambda output when sign in without password with amplify


AWS Cognito User Pool without a passwordIs there a way to cache GitHub credentials for pushing commits?Unrecognizable Lambda Output CognitoCognito auth flow fails with “Already found an entry for username Facebook_10155611263153532”AWS Cognito username/email login is case-sensitivePasswordless Cognito with SMS MFAAWS Cognito: Is there a way to provide Security token for scoped down IAM roles using Cognito?Cognito / Flask / React: how to log into backend?Unrecognized Verify Auth Challenge Lambda response C#AWS Cognito lambda triggers twiceContinue with custom auth flow after NEW_PASSWORD_REQUIRED challenge is answered in AWS Cognito






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am developing a custom auth flow in aws cognito with lambda triggers.



I used the sample code given by aws for lambda triggers DefineAuthChallenge_Authentication, CreateAuthChallenge_Authentication and VerifyAuthChallenge_Authentication, It's even explained in this answer,
AWS Cognito User Pool without a password



But when I sign in from frontend with amplify it says
code: "InvalidLambdaResponseException", name: "InvalidLambdaResponseException", message: "Unrecognizable lambda output"



After the Define auth challenge when create auth challenge is invoked the challenge is not in the event.request.session, it's an empty array. The challengeName attribute is just there in the event.response as following,



triggerSource: 'CreateAuthChallenge_Authentication',
request:
userAttributes:
sub: 'xxxxx-xxxxx-xxxx',
'cognito:user_status': 'CONFIRMED',
name: 'sala',
phone_number_verified: 'true',
'cognito:phone_number_alias': '+947xxxxxxxxx',
phone_number: '+947xxxxxxxxx' ,
challengeName: 'CUSTOM_CHALLENGE',
session: [] ,


Following is my define auth challenge,
`



exports.handler = async event => 
if (
event.request.session &&
event.request.session.length >= 3 &&
event.request.session.slice(-1)[0].challengeResult === false
)
// The user provided a wrong answer 3 times; fail auth
event.response.issueTokens = false;
event.response.failAuthentication = true;
else if (
event.request.session &&
event.request.session.length &&
event.request.session.slice(-1)[0].challengeResult === true
)
// The user provided the right answer; succeed auth
event.response.issueTokens = true;
event.response.failAuthentication = false;
else
// The user did not provide a correct answer yet; present challenge
event.response.issueTokens = false;
event.response.failAuthentication = false;
event.response.challengeName = 'CUSTOM_CHALLENGE';

return event;
;









share|improve this question






























    0















    I am developing a custom auth flow in aws cognito with lambda triggers.



    I used the sample code given by aws for lambda triggers DefineAuthChallenge_Authentication, CreateAuthChallenge_Authentication and VerifyAuthChallenge_Authentication, It's even explained in this answer,
    AWS Cognito User Pool without a password



    But when I sign in from frontend with amplify it says
    code: "InvalidLambdaResponseException", name: "InvalidLambdaResponseException", message: "Unrecognizable lambda output"



    After the Define auth challenge when create auth challenge is invoked the challenge is not in the event.request.session, it's an empty array. The challengeName attribute is just there in the event.response as following,



    triggerSource: 'CreateAuthChallenge_Authentication',
    request:
    userAttributes:
    sub: 'xxxxx-xxxxx-xxxx',
    'cognito:user_status': 'CONFIRMED',
    name: 'sala',
    phone_number_verified: 'true',
    'cognito:phone_number_alias': '+947xxxxxxxxx',
    phone_number: '+947xxxxxxxxx' ,
    challengeName: 'CUSTOM_CHALLENGE',
    session: [] ,


    Following is my define auth challenge,
    `



    exports.handler = async event => 
    if (
    event.request.session &&
    event.request.session.length >= 3 &&
    event.request.session.slice(-1)[0].challengeResult === false
    )
    // The user provided a wrong answer 3 times; fail auth
    event.response.issueTokens = false;
    event.response.failAuthentication = true;
    else if (
    event.request.session &&
    event.request.session.length &&
    event.request.session.slice(-1)[0].challengeResult === true
    )
    // The user provided the right answer; succeed auth
    event.response.issueTokens = true;
    event.response.failAuthentication = false;
    else
    // The user did not provide a correct answer yet; present challenge
    event.response.issueTokens = false;
    event.response.failAuthentication = false;
    event.response.challengeName = 'CUSTOM_CHALLENGE';

    return event;
    ;









    share|improve this question


























      0












      0








      0


      1






      I am developing a custom auth flow in aws cognito with lambda triggers.



      I used the sample code given by aws for lambda triggers DefineAuthChallenge_Authentication, CreateAuthChallenge_Authentication and VerifyAuthChallenge_Authentication, It's even explained in this answer,
      AWS Cognito User Pool without a password



      But when I sign in from frontend with amplify it says
      code: "InvalidLambdaResponseException", name: "InvalidLambdaResponseException", message: "Unrecognizable lambda output"



      After the Define auth challenge when create auth challenge is invoked the challenge is not in the event.request.session, it's an empty array. The challengeName attribute is just there in the event.response as following,



      triggerSource: 'CreateAuthChallenge_Authentication',
      request:
      userAttributes:
      sub: 'xxxxx-xxxxx-xxxx',
      'cognito:user_status': 'CONFIRMED',
      name: 'sala',
      phone_number_verified: 'true',
      'cognito:phone_number_alias': '+947xxxxxxxxx',
      phone_number: '+947xxxxxxxxx' ,
      challengeName: 'CUSTOM_CHALLENGE',
      session: [] ,


      Following is my define auth challenge,
      `



      exports.handler = async event => 
      if (
      event.request.session &&
      event.request.session.length >= 3 &&
      event.request.session.slice(-1)[0].challengeResult === false
      )
      // The user provided a wrong answer 3 times; fail auth
      event.response.issueTokens = false;
      event.response.failAuthentication = true;
      else if (
      event.request.session &&
      event.request.session.length &&
      event.request.session.slice(-1)[0].challengeResult === true
      )
      // The user provided the right answer; succeed auth
      event.response.issueTokens = true;
      event.response.failAuthentication = false;
      else
      // The user did not provide a correct answer yet; present challenge
      event.response.issueTokens = false;
      event.response.failAuthentication = false;
      event.response.challengeName = 'CUSTOM_CHALLENGE';

      return event;
      ;









      share|improve this question
















      I am developing a custom auth flow in aws cognito with lambda triggers.



      I used the sample code given by aws for lambda triggers DefineAuthChallenge_Authentication, CreateAuthChallenge_Authentication and VerifyAuthChallenge_Authentication, It's even explained in this answer,
      AWS Cognito User Pool without a password



      But when I sign in from frontend with amplify it says
      code: "InvalidLambdaResponseException", name: "InvalidLambdaResponseException", message: "Unrecognizable lambda output"



      After the Define auth challenge when create auth challenge is invoked the challenge is not in the event.request.session, it's an empty array. The challengeName attribute is just there in the event.response as following,



      triggerSource: 'CreateAuthChallenge_Authentication',
      request:
      userAttributes:
      sub: 'xxxxx-xxxxx-xxxx',
      'cognito:user_status': 'CONFIRMED',
      name: 'sala',
      phone_number_verified: 'true',
      'cognito:phone_number_alias': '+947xxxxxxxxx',
      phone_number: '+947xxxxxxxxx' ,
      challengeName: 'CUSTOM_CHALLENGE',
      session: [] ,


      Following is my define auth challenge,
      `



      exports.handler = async event => 
      if (
      event.request.session &&
      event.request.session.length >= 3 &&
      event.request.session.slice(-1)[0].challengeResult === false
      )
      // The user provided a wrong answer 3 times; fail auth
      event.response.issueTokens = false;
      event.response.failAuthentication = true;
      else if (
      event.request.session &&
      event.request.session.length &&
      event.request.session.slice(-1)[0].challengeResult === true
      )
      // The user provided the right answer; succeed auth
      event.response.issueTokens = true;
      event.response.failAuthentication = false;
      else
      // The user did not provide a correct answer yet; present challenge
      event.response.issueTokens = false;
      event.response.failAuthentication = false;
      event.response.challengeName = 'CUSTOM_CHALLENGE';

      return event;
      ;






      amazon-web-services authentication aws-lambda amazon-cognito






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 2:14









      John Rotenstein

      90.5k8 gold badges103 silver badges154 bronze badges




      90.5k8 gold badges103 silver badges154 bronze badges










      asked Mar 26 at 11:33









      Dinuka SalwathuraDinuka Salwathura

      4476 silver badges20 bronze badges




      4476 silver badges20 bronze badges






















          0






          active

          oldest

          votes










          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/3.0/"u003ecc by-sa 3.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
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55356145%2finvalidlambdaresponseexception-unrecognizable-lambda-output-when-sign-in-witho%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55356145%2finvalidlambdaresponseexception-unrecognizable-lambda-output-when-sign-in-witho%23new-answer', 'question_page');

          );

          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







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현