Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion with confirm endpoint #284

Closed
schafer14 opened this issue Feb 23, 2020 · 2 comments
Closed

Confusion with confirm endpoint #284

schafer14 opened this issue Feb 23, 2020 · 2 comments

Comments

@schafer14
Copy link

schafer14 commented Feb 23, 2020

I am having some trouble understanding the /confirm endpoint. I am using the /register endpoint to generate a confirmSelector and confirmVerifier and an email. My problem is understanding how to generate a confirm request given that email.

I am trying to base64 encode the cnf token and send it in the request body, but I am receiving an error saying the token size is wrong. I think I'm probably just not understanding the correct process.

Here is an example of the email I am getting back:

Please copy and paste the following link into your browser to confirm your account\n\nhttp://0.0.0.0:3000/v1/auth/confirm?cnf=HBrP32B1BtpoFnCAIapYTWMnbIu_8BkSNCfl0AHEoPSONIVsu5DHs-iQmpTE3YAEmEXDPq32N1w1YciKUv2lXg%3D%3D

I am also logging some information as it is stored

confirmSelector: u7NnGYgO6vrWFWqQJ3vpN/Tg+4Qo9E6yg/7xE4005+IC8yNpy4Wq1pSaCYk+PW5RSGvxaVOxtq3ZjyeU2bo7MA==
confirmVerifier: aXMHk8FIaRHaTEmYxmG13t6wMJGLG9EJfxwFa2CWyczXED58qnMbvVnWdTP1KDKz7aze+0ombeKsmIgvTa1sXA==

Neither of these look like the cnf string in the email which maybe causing confusion. If you need any more information let me know.

@aarondl
Copy link
Member

aarondl commented Mar 9, 2020

This snippet shows basically how the confirm module retrieves the value from the token.

https://play.golang.org/p/2i5xIpssJyi

Maybe that can help you out? From your description it's hard to understand exactly what you're trying to accomplish. Are you trying to recreate the token from the e-mail link? Or are you trying to manually re-implement confirms logic?

You mention creating a confirm request which sounds like you're in API mode. In which case the user navigates to your page, you pull the cnf token from the query string and pass it in as cnf to the API endpoint.

@schafer14
Copy link
Author

Thanks for the response. I was getting super confused. The problem I had was just the URL was coming back with %3D and I was changed those to = characters. I guess this question is not relevant in that case.

Thanks anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants