Skip to content

Implementation of Oauth of Github, Google and Microsoft #4298

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

Merged
merged 113 commits into from
Mar 28, 2025

Conversation

feyruzb
Copy link
Collaborator

@feyruzb feyruzb commented Jul 18, 2024

fixes #4160

The right way it should look after logging in
Screenshot from 2024-07-18 17-38-29

new added button to log in with github
Screenshot from 2024-07-18 17-40-36

Changes:

  • added new buttons on login page for GitHub,Google Oauth authorization
  • added functions createLink and getOAuthToken into authentication.thrift
  • imported OAuth2Session in client.py
  • added a case for Oauth authorization in login_user function
  • added definition for thrift
  • imported OAuth2Session in authentication.py
  • added code to load the authentication configuration from
  • added oauth method for authentication in performLogin function
  • added oauth case in session manager
  • added fields for server_config file in the server_config.json
  • added oauth cases in auth.js
  • added reusable providers dict to server config to allow easier adding of new oauth providers
  • create a new function get_oauth_config for getting different providers configs in session manager
  • added documentation for configuration

@feyruzb feyruzb requested review from bruntib and vodorok as code owners July 18, 2024 15:47
@feyruzb feyruzb force-pushed the branch-2-backup branch 2 times, most recently from 5ce7f18 to 68eaf7b Compare July 25, 2024 11:05
@feyruzb feyruzb requested a review from dkrupp as a code owner July 29, 2024 15:14
@feyruzb feyruzb force-pushed the branch-2-backup branch 2 times, most recently from de2e213 to d3f6b29 Compare July 30, 2024 11:02
Copy link
Contributor

@vodorok vodorok left a comment

Choose a reason for hiding this comment

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

Please see my remarks.

I have some additional comments apart from the direct in code messages:

  • My major concern with the implementation is that the oauth related API and its implementation is not generalized enough. The configuration is good enough for the time being.
  • I am not sure if we are allowed to use the Git Hub logo in our repo.
  • Please invite @cservakt to review the JS and VueJS parts.

I did not do a thorough review of the oauth flow in authentication.py after you addressed the above issues I will do another round concentrating on that.

Thanks for the hard work!

@feyruzb feyruzb force-pushed the branch-2-backup branch 10 times, most recently from 12c68e7 to f064c2b Compare July 31, 2024 14:41
@feyruzb feyruzb requested a review from vodorok July 31, 2024 15:03
@feyruzb feyruzb force-pushed the branch-2-backup branch 3 times, most recently from b4d5a0a to d3847d6 Compare July 31, 2024 16:05
@feyruzb feyruzb force-pushed the branch-2-backup branch 9 times, most recently from 1f09f7c to 9d7d0c7 Compare March 11, 2025 16:53
@feyruzb feyruzb force-pushed the branch-2-backup branch 4 times, most recently from a990318 to d98ca60 Compare March 17, 2025 16:37
match = pattern.match(callback_url)
if match is None:
LOG.warning("Configuration format of callback_url is "
f"invalid for provider {provider_name}."
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an extra space to the end so the next sentence is separate.
Also, this message should be printed only if the given provider is enabled.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

"client_id" : "ExampleClientID",
"client_secret": "ExampleClientSecret",
"authorization_url": "https://github.com/login/oauth/authorize",
"callback_url": "http://server_host/login/OAuthLogin/provider",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest https. A the other providers, too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@feyruzb feyruzb force-pushed the branch-2-backup branch 2 times, most recently from 8b078c0 to 7f39ebe Compare March 25, 2025 15:36
…ck_url, removed unnecessary code from fetching token
Copy link
Contributor

@Discookie Discookie left a comment

Choose a reason for hiding this comment

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

Looks good enough to merge for now - there are still some open questions around CLI usage and about what identifier to use to uniquely identify a user across all login methods, but those can be added on separately.

@bruntib bruntib dismissed dkrupp’s stale review March 28, 2025 09:47

Based on personal agreement the PR can be merged for now.

@bruntib bruntib merged commit 20d400b into Ericsson:master Mar 28, 2025
7 of 8 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.

OpenID Connect based authentication (oauth)
7 participants