Conversation
There was a problem hiding this comment.
PR Overview
This pull request enhances logging for OIDC logins by capturing additional claims from the federated token as suggested in issue #505.
- Updated error messaging for token fetching
- Added logging for 'audience' and 'job_workflow_ref' claims
- Extended the jwtParser function to return additional claims
Reviewed Changes
| File | Description |
|---|---|
| src/common/LoginConfig.ts | Updated token fetching and parsing to include more claims and improved logging of error messages |
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/common/LoginConfig.ts:90
- Consider including error details (e.g. error.message) in the warning log to aid in debugging token parsing issues.
core.warning("Failed to parse the federated token. Missing necessary claims.");
YanaXu
reviewed
Mar 3, 2025
src/common/LoginConfig.ts
Outdated
| let bufferObj = Buffer.from(tokenPayload, "base64"); | ||
| let decodedPayload = JSON.parse(bufferObj.toString("utf8")); | ||
| return [decodedPayload['iss'], decodedPayload['sub']]; | ||
| const requiredClaims = ['iss', 'sub', 'aud', 'job_workflow_ref']; |
Collaborator
There was a problem hiding this comment.
define a const value for this.
YanaXu
approved these changes
Mar 3, 2025
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.
As suggested in issue #505, adding more claim logs for OIDC login would be beneficial. This pr logs
audienceandjob_workflow_refin addition toissuerandsubject. For details on the GitHub federated token format, refer to https://token.actions.githubusercontent.com/.well-known/openid-configuration, and https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-tokenClose #505