-
Notifications
You must be signed in to change notification settings - Fork 433
Feature/google signin identity token #3940
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
Conversation
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.
Pull Request Overview
This PR updates the Google Sign-In implementation to properly handle ID tokens by storing them in the AccessToken object alongside access tokens. The changes ensure that the ID token received from Google Sign-In is preserved and made available through the AccessToken, even when access token retrieval fails.
- Modifies AccessToken creation to include ID token parameter
- Preserves ID token in error scenarios where access token retrieval fails
- Updates token handling to use multi-parameter AccessToken constructor
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| String idToken = json.containsKey("id_token") ? (String) json.get("id_token") : requestIdToken; | ||
|
|
||
| // Use the constructor that includes all token fields | ||
| setAccessToken(new AccessToken(accessToken, expiresIn, refreshToken, idToken)); |
Copilot
AI
Sep 23, 2025
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.
The code assumes a 4-parameter AccessToken constructor exists, but this may be a breaking change if the existing AccessToken class doesn't support this constructor signature. Consider verifying that the AccessToken class has been updated to support these parameters.
| setAccessToken(new AccessToken(accessToken, expiresIn, refreshToken, idToken)); | |
| AccessToken token = new AccessToken(accessToken, expiresIn); | |
| // Set refreshToken and idToken if setters are available | |
| try { | |
| java.lang.reflect.Method setRefreshToken = token.getClass().getMethod("setRefreshToken", String.class); | |
| setRefreshToken.invoke(token, refreshToken); | |
| } catch (Exception e) { | |
| // Setter not available, ignore | |
| } | |
| try { | |
| java.lang.reflect.Method setIdToken = token.getClass().getMethod("setIdToken", String.class); | |
| setIdToken.invoke(token, idToken); | |
| } catch (Exception e) { | |
| // Setter not available, ignore | |
| } | |
| setAccessToken(token); |
No description provided.