Skip to content

Commit

Permalink
Remove x5t Header Check
Browse files Browse the repository at this point in the history
This check doesn't exist on the Terraform provider, and was added in the initial commit of this builder.  It's a very old change that I do not think is required anymore

An Azure employee reported that with entra minted tokens, this validation causes failures: #451
  • Loading branch information
JenGoldstrich committed Nov 4, 2024
1 parent 6c21022 commit 2c86082
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions builder/azure/common/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,10 @@ func (c Config) Validate(errs *packersdk.MultiError) {
c.ClientJWT != "" {
p := jwt.Parser{}
claims := jwt.StandardClaims{}
token, _, err := p.ParseUnverified(c.ClientJWT, &claims)
_, _, err := p.ParseUnverified(c.ClientJWT, &claims)
if err != nil {
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_jwt is not a JWT: %v", err))
} else {
if t, ok := token.Header["x5t"]; !ok || t == "" {
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_jwt is missing the x5t header value, which is required for bearer JWT client authentication to Azure"))
}
}

return
}

Expand Down

0 comments on commit 2c86082

Please sign in to comment.