MycroftAI / selene-backend

Microservices and web apps to support Mycroft devices
GNU Affero General Public License v3.0
144 stars 53 forks source link

sso.mycroft.ai account registration is broken #202

Open theCalcaholic opened 4 years ago

theCalcaholic commented 4 years ago

I'm unsure which repository this issue should be created on, so I'm opening it here.

I've been trying to register an account with home.mycroft.ai. However, both, email registration and registration with Github as identity provider fail (with different errors).

Email registration

Steps to reproduce

  1. Open https://sso.mycroft.ai/new-account
  2. Fill in your email and password
  3. Click on next, then accept the terms of use and privacy policy.
  4. Click on "Create Account"

Expected result

A new account should be created that you can log into.

Actual result

The page shows a Toast with the message: "An error occurred, account not added." The Browser dev tools reveal the following error message:

Backend returned code 500, body was: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>

Registration via Github

Steps to reproduce

  1. Open https://sso.mycroft.ai/new-account
  2. Select "Login with Github" and confirm the upcoming dialog
  3. Click on next, then accept the terms of use and privacy policy.
  4. Click on "Create Account"

Expected result

A new account should be created that you can log into.

Actual result

The page shows a Toast with the message: "An error occurred, account not added." The Browser dev tools reveal the following error message:

Backend returned code 400, body was: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p><p><pre><code>KeyError: 'federated_token'</code></pre></p>

Tested on Chromium and Firefox.

forslund commented 4 years ago

Thanks for reporting. I'll ping @chrisveilleux and will transfer the issue to one of the backend repos.

theCalcaholic commented 4 years ago

Thank you. Btw, I noticed that the token transferred during registration via Github has a slightly different key than mentioned in the error message (federatedToken instead of federated_token).

nelsonblaha commented 4 years ago

This is stopping me from using Mycroft.

chrisveilleux commented 4 years ago

My apologies for not following up on this sooner, I hope to make some time to investigate this issue next week.

marhkb commented 4 years ago

Sadly it is still not possible to create an account. Any updates on this?

chrisveilleux commented 4 years ago

@marhkb Could you provide more color on what you did to attempt account creation? The fix to the GitHub account creation issue was tested by several and is running in our production environments.

hslr4 commented 3 years ago

I think there is a problem in the ValidateEmailEndpoint it seems to always return accountExists=False which causes a 500 Internal Server Error when trying to write the same email again to the DB (psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "account_email_address_key").

At least this fits the problem I had when I tried to register with an email I did not remember I had an account with already. So trying to reset your password instead of creating an account might help in case someone else facing a 500 error on account creation gets here before the problem is fixed.