Login problems office365 AADSTS50011

I found this topic and similar here, when I digging how to solve O365 authorization problem after moving server behind a proxy.

For those who will come to this topic from search, take into an account two points:

  1. Check if force_https option is enabled.
  2. If your Discourse is behind an SSL proxy, try the setting proxy_set_header X-Forwarded-Proto "https"; in Nginx config of your Discourse server.
Details

Facebook Login Error: CSRF detected - #3 by Ivan_Rapekas