SSO Authentication - Https - NGINX configuration

  • Hi folks,

    I am currently struggling on using sso plugins with my nodebb instance (online).
    I have done quite some researches here and from the web, but did not get any answer.
    Still, I saw several topics about the subject.
    Thanks for having a look, and hope it could help others too.

    I handle SSL using a nginx reverse-proxy behind all my nodes applications and here are the errors found :
    Oops! Looks like something went wrong!
    Bad Request

    Oops! Looks like something went wrong!
    The redirect_uri MUST match the registered callback URL for this application.

    ... and same kind of error for FB.

    Concerning the App configuration it seems well configured with an Https callback URL: as homepage.

    My NGINX configuration try to pass all needed information within the header :
    proxy_pass http://localhost:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-Port 443;

    And finally the traces I think the problem comes from, the (it's not the case for this nodeBB forum)

    Github 302 (OK) :
    GET /auth/github HTTP/1.1

    GET /auth/github HTTP/1.1

    Authorize (PROBLEM) :
    GET /login/oauth/authorize?response_type=code&

    GET /login/oauth/authorize?response_type=code& HTTP/1.1

    Why am I loosing the S from the protocol ?!

    Thank you for your help.
    Kind regards.

  • Finally found a topic with good explanation an answers:

    Didn't expect the config.json would influence such requests.

    Kind regards.

Suggested Topics

  • 11
  • 1
  • 13
  • 11
  • 4
| |