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?

Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions