-
Notifications
You must be signed in to change notification settings - Fork 0
Google auth implemented #13
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
base: master
Are you sure you want to change the base?
Conversation
google_auth/google.py
Outdated
| try: | ||
| # Allow a small clock skew of 2 seconds | ||
| idinfo = id_token.verify_oauth2_token(auth_token, requests.Request(), clock_skew_in_seconds=5) | ||
| if 'accounts.google.com' in idinfo['iss']: |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Surfskills please address this; It's flagged as a high security risk; ensure sanitized URLs throughout the code.
|
@Surfskills can we get this resolved quickly ?? |
|
| filtered_user_by_email = User.objects.filter(email=email) | ||
|
|
||
| if filtered_user_by_email.exists(): | ||
| print(f"User with email {email} exists.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ensure we remove prints in production but aside that I think we are good
| POST with "auth_token" | ||
| Send an idtoken as from google to get user information | ||
| """ | ||
| print('Request data:', request.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also let take this out as well for production
Title: Implement Google Social Authentication
Description:
This pull request adds support for Google social authentication to our application. The following changes have been made:
Installed Required Packages:
google-authandgoogle-auth-oauthlibto the project dependencies.Configured Google Client ID:
GOOGLE_CLIENT_IDto store the Google OAuth client ID.GOOGLE_CLIENT_IDinsettings.py.Created Google Authentication Utility:
validate_google_tokento validate Google OAuth tokens usinggoogle.auth.transport.requestsandgoogle.oauth2.id_token.Updated User Model and Manager:
auth_providerfield has a default value for new users.Added Google Social Auth View:
GoogleSocialAuthViewin thegoogle_authapp to handle the authentication process.Updated URLs:
urls.py.Debugging and Error Handling:
Testing: