Commit f26eb2c
Fix base64 encoding for JWT token (#3367)
The eng/common/scripts/login-to-github.ps1 script was failing because it was using the standard Base64 encoded
signature returned by Azure Key Vault directly in the JWT, instead of converting it to Base64URL format (which
replaces + with -, / with _, and removes trailing =).
I have fixed the script by adding the necessary character replacements and also added a 10-second clock skew buffer
to the iat (issued at) claim to ensure validity.
The script now runs successfully and logs in as azure-sdk-automation[bot].
Changes made:
- Modified eng/common/scripts/login-to-github.ps1:
- Converted the signature from Azure Key Vault to Base64URL format.
- Subtracted 10 seconds from the iat claim to account for potential clock skew.
Verification:
- Ran the script and confirmed it successfully resolved the installation ID for "Azure" and obtained an access
token.
- gh auth status output confirms successful login.
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>1 parent 0ac3772 commit f26eb2c
1 file changed
+13
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
| |||
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | | - | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
0 commit comments