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 Scoped Login #804

Merged
merged 7 commits into from
Aug 6, 2023
Merged

Google Scoped Login #804

merged 7 commits into from
Aug 6, 2023

Conversation

lucadealfaro
Copy link
Collaborator

I added a new auth plugin, which implements google Oauth2 login with the ability to get additional scopes.
There are some differences wrt. other OAuth2 plugins:
- The plugin uses the database, and creates an auth_credentials table to
store the credentials for the scopes requested.
- The plugin relies on some google libraries (see on top), so these
need to be installed.
- The plugin takes in input a .json credentials file that can be
downloaded from Google Cloud when creating the OAuth2 credentials.
This has been tested.

@lucadealfaro
Copy link
Collaborator Author

Note: I also changed auth.py so that if one of these OAuth2 plugins is used, and the login expires, the user is redirected by AuthEnforcer to the plugin URL, and not to the form that asks to login with username/password. In fact, if a site is using one of these OAuth2 plugins, there is most likely no username/password for the user, and so showing the form is quite confusing.

self.secrets_file = secrets_file
# Scopes for which we ask authorization
scopes = scopes or []
self.scopes = ["openid",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear which members are supposed to be accessed publicly and which not, for the latter we should use an _ prefix

@mdipierro mdipierro merged commit 72ff34e into master Aug 6, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants