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?

已提问 1 年前107 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则