Enhance openGoogleAuthPopup to include OAuth state - #82
Open
mspandey wants to merge 1 commit into
Open
Conversation
Added state parameter to the Google Auth popup response for validation.Add OAuth State Validation to Google Authentication Flow Summary This PR improves the security of the Google OAuth authentication flow by implementing OAuth state parameter generation and validation. Changes Added generation of a unique OAuth state value before initiating Google sign-in. Included the generated state in Google authorization requests. Stored the state in session storage during the authentication process. Validated the returned state value before accepting the access token. Rejected authentication responses with missing or mismatched state values. Motivation The current Google OAuth implementation does not validate the OAuth state parameter. Without state verification, authentication flows can be vulnerable to CSRF (Cross-Site Request Forgery) and authorization response spoofing attacks. Implementing state validation follows OAuth 2.0 security best practices and ensures that authentication responses are tied to requests initiated by the current user session. Impact Improves authentication security. Reduces the risk of OAuth-related CSRF attacks. Ensures only valid authorization responses are accepted. Aligns the Google sign-in implementation with recommended OAuth security guidelines. Testing Verified Google sign-in flow with a valid state value. Verified authentication succeeds when the returned state matches the stored value. Verified authentication is rejected when the state value is missing or invalid. Confirmed existing session handling continues to function as expected.
|
🎉 Thanks for submitting a PR, @mspandey! Please confirm the following checklist before review:
A maintainer will review your PR shortly. Thank you! 🚀 |
Owner
|
ESOC or SSOC ? and please read contribution guidlines |
Author
|
This is my first time doing open source can you guide me where I went wrong?
…On Fri, 19 Jun 2026, 1:53 pm Madhav Majumdar, ***@***.***> wrote:
*madhav2348* left a comment (madhav2348/ss_ai#82)
<#82 (comment)>
ESOC or SSOC ? and please read contribution guidlines
—
Reply to this email directly, view it on GitHub
<#82?email_source=notifications&email_token=BWCE2HBB54FJBMHZHP3OVZT5ATZ7JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZUHE4DAOBWHA2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4749808684>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BWCE2HBNX7UIBIL3PLI7HDL5ATZ7JAVCNFSNUABGKJSXA33TNF2G64TZHMYTCNZYGY3TQOJTGM5US43TOVSTWNBWHE4DKMZSHA3TNILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BWCE2HC6SEHUZYQL7FWDV635ATZ7JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZUHE4DAOBWHA2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/BWCE2HAOEPQFXPM3KCU6GOT5ATZ7JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZUHE4DAOBWHA2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Owner
|
please read guidlines , Program timeline, dont start spamming , join discord and talk with team members, admins before doing anything, i know its your first time, but dont spam, join discord or whatsapp channel |
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.
Add state parameter to OAuth flow for validationconst ## Summary
Add OAuth state validation to the Google authentication flow.
Changes Made
stateparameter before initiating Google sign-in.Why This Change?
The current Google OAuth implementation does not include a
stateparameter. Without state validation, the application is more vulnerable to CSRF and authorization response spoofing attacks.Adding state verification aligns the authentication flow with OAuth 2.0 security best practices and improves protection against malicious or unexpected authorization responses.
Impact