Skip to content

Enhance ADO token retrieval by adding JWT parsing functionality #332

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

Merged
merged 3 commits into from
Jun 12, 2025

Conversation

MattB-msft
Copy link
Member

This pull request modifies the .github/actions/get-ado-token/action.yml file to enhance token handling and introduce a new function for parsing JWT tokens. The most significant change is the addition of the Parse-JWTtoken function, which decodes and parses the payload of a JWT token for better usability and debugging.

Enhancements to token handling:

  • Added the Parse-JWTtoken function to decode and parse JWT token payloads, including converting the payload from Base64 to JSON format and returning it as a PowerShell object. This improves token processing and debugging capabilities.
  • Replaced the Get-AzAccessToken command with az account get-access-token for obtaining the access token, aligning with updated Azure CLI practices.

@github-actions github-actions bot added the Build: Automation Tags changes to Build Automation area label Jun 12, 2025
@MattB-msft MattB-msft marked this pull request as ready for review June 12, 2025 22:45
@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 22:45
@MattB-msft MattB-msft requested a review from a team as a code owner June 12, 2025 22:45
Copy link
Contributor

@Copilot Copilot AI left a 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 enhances the ADO token retrieval process by replacing the previous Azure PowerShell command with an updated Azure CLI command and introducing a JWT parsing function.

  • Replaces Get‐AzAccessToken with az account get‐access-token to align with current Azure CLI practices.
  • Implements a new decodeToken function to decode and parse the JWT token payload.

@MattB-msft MattB-msft enabled auto-merge (squash) June 12, 2025 22:49
@MattB-msft MattB-msft merged commit 343d7da into main Jun 12, 2025
8 checks passed
@MattB-msft MattB-msft deleted the users/mbarbour/modBuild branch June 12, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: Automation Tags changes to Build Automation area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants