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 user identification #95

Closed
pollier opened this issue Feb 14, 2018 · 5 comments
Closed

Google Oauth user identification #95

pollier opened this issue Feb 14, 2018 · 5 comments
Labels

Comments

@pollier
Copy link

pollier commented Feb 14, 2018

Hello,
I'm currently playing with the auth system,
actually using nginx with http basic_auth, i would like to know if an Oauth connector like the ldap one is possible ?
If not, do you know a way to handle this with apache2 / nginx ?

@bugy
Copy link
Owner

bugy commented Feb 14, 2018

Hi @pollier, this should be possible to add this feature, according to tornado documentation.
I'll try to do it this week

bugy added a commit that referenced this issue Feb 21, 2018
@bugy
Copy link
Owner

bugy commented Feb 21, 2018

Hi @pollier, I made the first version of Google Oauth integration. In order to use it, add/change following settings in conf.json file:

"auth": {
    "type": "google_oauth",
    "client_id": "your_client_id",
    "secret": "your_secret"
  },

In order for oauth to work, both client and server should have connection to google servers (https://accounts.google.com and https://www.googleapis.com)

For configuring access in google, you can follow this guide: http://www.tornadoweb.org/en/stable/auth.html#google

For Oauth key, you should add the following "Authorized redirect URI": your_server_address/login
E.g. http://localhost:5000/login. If you are running the server behind reverse proxy, then the URL should match the address, visible to a user

Regarding list of allowed users - I didn't find a way how to configure allowed users in google, so I'm going to implement it in script-server. And this setting will be mandatory for google oauth (otherwise everyone would have access to it, which is quite dangerous).

@pollier
Copy link
Author

pollier commented Feb 23, 2018

Thank you :)
I'm quite busy this week but will test it soon 👍

bugy added a commit that referenced this issue Feb 25, 2018
…nd show login error properly on html page, instead of as pure REST response
@bugy
Copy link
Owner

bugy commented Feb 25, 2018

Important change: now redirect URI in google config should be url/login.html (i.e. html page instead of rest URL)

@bugy
Copy link
Owner

bugy commented Feb 25, 2018

Added authorization support (which users can access the server). There is a new field: "allowed_users" for auth config block. This setting is mandatory, when Google OAuth is used.
Value should be a list, e.g.:
"allowed_users": ["user1", "user2"]
If any user should be able to access the server, use asterisk:
"allowed_users": ["*"]
or
"allowed_users": "*"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants