Oauth2 redirect_uri utilise HTTP alors que votre forum utilise HTTPS

Bonjour,

J’ai récemment activé HTTPS pour mon forum Discourse (Let’s Encrypt + nginx sur le système hôte). Aucune redirection n’a été ajoutée, de sorte que les visiteurs peuvent utiliser HTTP ou HTTPS. Tout a fonctionné comme prévu.

Ensuite, j’ai essayé d’activer l’authentification Google OAuth2. Cependant, j’ai remarqué que Discourse appelait Google OAuth2 avec redirect_uri défini sur l’URL HTTP du forum, alors que le forum était ouvert en HTTPS.

Comment puis-je résoudre ce problème ? Mon forum est https://discussion.listary.com/. Merci d’avance pour toute aide.

Do You have force https enabled?

1 « J'aime »

No. Is there a Discourse setting for that?

Indeed there is!

In admin > settings
Search for force https and enable it.

2 « J'aime »

Just tried that setting. And unfortunately, it’s still the same.

I think Discourse should be able to detect the original protocol automatically. I don’t know why it doesn’t work in my case.

I got it working. I used Certbot to manage Let’s Encrypt on my host system. It turned out that some rules Certbot added to the nginx config file is not fully compaitible with Discourse docker. I fixed it according to Running other websites on the same machine as Discourse.

3 « J'aime »