Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google OAuth: Fail to sign in on domain #576

Open
irogers opened this issue Aug 5, 2020 · 3 comments
Open

Google OAuth: Fail to sign in on domain #576

irogers opened this issue Aug 5, 2020 · 3 comments
Assignees

Comments

@irogers
Copy link

irogers commented Aug 5, 2020

Hi there,

Thanks for the great tool! I'm very excited to use it to manage organisational data science knowledge.

I'm struggling to get Google OAuth working on a remote server. Everything works fine on localhost after setting OAUTHLIB_RELAX_TOKEN_SCOPE=true. However if I run knowledge_repo deploy --config config --engine flask on the remote server (with a domain like subdomain.domain.com) the redirect from Google OAuth does not raise any errors, but the user is not logged in. I have ensured that SERVER_NAME = 'subdomain.domain.com:7000' in the config.

On localhost, user is logged in

knowledge-app | INFO  [werkzeug] 172.23.0.1 - - [09/Aug/2020 07:00:41] "GET /auth/login HTTP/1.1" 302 -
knowledge-app | INFO  [werkzeug] 172.23.0.1 - - [09/Aug/2020 07:00:41] "GET /auth/login/google/ HTTP/1.1" 302 -
knowledge-app | INFO  [werkzeug] 172.23.0.1 - - [09/Aug/2020 07:00:48] "GET /auth/login/google/authorize?state=nknWhbGxA2URfZaJvIg5rna5d5UpsL&code=<code>&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.profile%20openid%20https://www.googleapis.com/auth/userinfo.email&authuser=0&hd=dataq.co.za&prompt=none HTTP/1.1" 302 -
knowledge-app | INFO  [werkzeug] 172.23.0.1 - - [09/Aug/2020 07:00:48] "GET /feed HTTP/1.1" 200 -

On server, user is not logged in

knowledge-app | INFO  [werkzeug] 169.0.57.134 - - [09/Aug/2020 06:40:35] "GET /auth/login HTTP/1.1" 302 -
knowledge-app | INFO  [werkzeug] 169.0.57.134 - - [09/Aug/2020 06:40:36] "GET /auth/login/google/ HTTP/1.1" 302 -
knowledge-app | INFO  [werkzeug] 169.0.57.134 - - [09/Aug/2020 06:45:20] "GET /auth/login/google/authorize?state=l0OLuJjEcw7mWNYngFFzA2wFvWsdl2&code=<code>&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile%20openid&authuser=0&hd=dataq.co.za&prompt=none HTTP/1.1" 302 -
knowledge-app | INFO  [werkzeug] 169.0.57.134 - - [09/Aug/2020 06:45:58] "GET /feed HTTP/1.1" 200 -
@irogers
Copy link
Author

irogers commented Aug 9, 2020

It looks like remember is not set for login_user

@bulam
Copy link
Collaborator

bulam commented Aug 14, 2020

Hi @irogers
Thanks for raising this issue. Were you able to resolve it with last comment?

@irogers
Copy link
Author

irogers commented Aug 14, 2020

Sure thing. Yes setting remember allowed me to login

    def _perform_login(self, user):
        user = prepare_user(user)
        login_user(user, remember=True)

@naoyak naoyak self-assigned this Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants