Skip to content
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

Use JWT token for user id #976

Merged
merged 2 commits into from
Jun 13, 2024
Merged

Use JWT token for user id #976

merged 2 commits into from
Jun 13, 2024

Conversation

tyaginidhi
Copy link
Contributor

This pull request primarily focuses on improving the way user IDs are obtained from session tokens across various files. The changes replace the previous method of extracting the user ID from the session.account.id field with a new function getOIDFromToken. This function uses the jwt-decode library to decode the session access token and extract the user ID. This change is applied consistently across multiple authentication functions in the AuthenticationProvider.ts file and in the PowerPagesCopilot.ts file.

Additionally, a new telemetry event VSCODE_EXTENSION_DECODE_JWT_TOKEN_FAILED is introduced to capture any errors that occur during the decoding process.

Here are the key changes:

@tyaginidhi tyaginidhi marked this pull request as ready for review June 13, 2024 07:42
@tyaginidhi tyaginidhi requested review from a team as code owners June 13, 2024 07:42
@tyaginidhi tyaginidhi enabled auto-merge (squash) June 13, 2024 08:21
@tyaginidhi tyaginidhi merged commit a256808 into main Jun 13, 2024
6 checks passed
@tyaginidhi tyaginidhi deleted the users/nityagi/JWTForUserID branch June 13, 2024 09:33
tyaginidhi added a commit that referenced this pull request Jun 13, 2024
* Use JWT token for user id

* fix test case
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.

None yet

3 participants