Login redirects to homepage, shows no error

AI-generated summary

The user, Daniel_Sousa, encountered an issue where login attempts redirected to the homepage without errors after disabling SSO and enabling local logins on a Discourse instance running on EC2. The issue was resolved by adding a DNS record and enabling Let’s Encrypt, which allowed SSO to function properly. Daniel_Sousa initially faced problems with login and account creation, but codinghorror suggested checking the browser or network, leading Daniel to realize the problem was due to accessing the instance via IP without proper DNS and SSL configuration. Daniel_Sousa confirmed the issue was resolved after making these changes.

I have a Discourse instance running which had SSO turned on. I got locked out due to misconfiguration.

Proceeded with changing a couple of settings:

./launcher enter app
rails c
SiteSetting.enable_sso = false
SiteSetting.enable_local_logins = true
exit

Trying to login directly shows no error and redirects to the home page. No errors are shown.
Also tried using the /users/admin-login.

Log output:

Started GET "/u/admin-login/490c222f04e33b2c59cc6fbdab2e7373" for <IP> at 2018-07-19 16:27:18 +0000
Processing by UsersController#admin_login as HTML
  Parameters: {"token"=>"490c222f04e33b2c59cc6fbdab2e7373"}
Redirected to http://<discourse address>
Completed 302 Found in 28ms (ActiveRecord: 7.0ms)
Started GET "/" for <IP> at 2018-07-19 16:27:18 +0000
Started GET "/" for <IP> at 2018-07-19 16:32:52 +0000
Processing by CategoriesController#index as HTML
Rendering categories/index.html.erb within layouts/application
Rendered categories/index.html.erb within layouts/application (1.3ms)
Rendered layouts/_head.html.erb (0.2ms)
Rendered common/_discourse_stylesheet.html.erb (0.1ms)
Rendered common/_special_font_face.html.erb (0.1ms)
Rendered application/_header.html.erb (0.1ms)
Rendered common/_discourse_javascript.html.erb (0.2ms)
Completed 200 OK in 93ms (Views: 6.4ms | ActiveRecord: 22.4ms)
Started GET "/" for <IP> at 2018-07-19 16:32:52 +0000

Anything I’m missing?

When signing up for an account I get this error:
We cannot detect if your account was created, please ensure you have cookies enabled.

Is this on a local instance? Are you on our hosting? I’m confused.

This implies there is something going very awry with your browser or network. I suggest using a different web browser, one you don’t normally use?

This is a instance running in a EC2. Using this for staging purposes, which makes developing new integrations and updating the theme easier. Its mirroring our hosted instance we have with you.

Pretty sure I found out the reason, I’m accessing it directly by the IP Address, didn’t add a DNS record that points to it and didn’t configure Let’s Encrypt too.

Whats your thoughts?

@codinghorror

All good now. Added a DNS record and enabled Let’s Encrypt.

SSO working properly!