Open
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
Collaborator
There was a problem hiding this comment.
@Surfskills please address this; It's flagged as a high security risk; ensure sanitized URLs throughout the code.
Member
|
@Surfskills can we get this resolved quickly ?? |
Collaborator
Author
|
bright2kwame
approved these changes
Jun 6, 2024
| filtered_user_by_email = User.objects.filter(email=email) | ||
|
|
||
| if filtered_user_by_email.exists(): | ||
| print(f"User with email {email} exists.") |
Member
There was a problem hiding this comment.
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) |
Member
There was a problem hiding this comment.
Also let take this out as well for production
ikeecode
approved these changes
Jun 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: