-
Notifications
You must be signed in to change notification settings - Fork 381
Log more claims for OIDC login #520
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.
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.");
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']; |
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.
define a const value for this.
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