Complete a custom passwordless cognito auth flow, and getting tokens in a node app

0

Hey there! I've implement a magic-link auth flow (via this tutorial: https://theburningmonk.com/2023/03/implementing-magic-links-with-amazon-cognito-a-step-by-step-guide/) but I'm having a hard time actually getting the users tokens from the frontend to the backend.

The auth flow is kicked off from a custom CLI I am building. I send a user an email, they click the link in that email to verify their user, and on the front end I sign the user in and send the challenge response

const cognitoUser = await Auth.signIn(email);
const challengeResult = await Auth.sendCustomChallengeAnswer(cognitoUser, token);

This is all successful, but my challenge is I want the tokens (id_token, access_token) to be retrievable from my CLI and then saved to a local auth config file. My CLI is in a listening-for-verification state at this point. A bit stuck on how to proceed here. Any guidance on best practices to achieve this?

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠