Skip to content

Commit 0f49ca8

Browse files
authored
Freddydk/renewauth (#3767)
Renew federated token when access token needs renewal (works only on GitHub) --------- Co-authored-by: freddydk <[email protected]>
1 parent 08e2f35 commit 0f49ca8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Auth/Renew-BcAuthContext.ps1

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ try {
3232
$bcAuthContext
3333
}
3434
else {
35+
if ($bcAuthContext.ContainsKey('clientAssertion') -and "$ENV:ACTIONS_ID_TOKEN_REQUEST_TOKEN" -ne "" -and "$ENV:ACTIONS_ID_TOKEN_REQUEST_URL" -ne "") {
36+
Write-Host "Renew federated token"
37+
$result = Invoke-RestMethod -Method GET -UseBasicParsing -Headers @{ "Authorization" = "bearer $ENV:ACTIONS_ID_TOKEN_REQUEST_TOKEN"; "Accept" = "application/vnd.github+json" } -Uri "$ENV:ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange"
38+
$bcauthContext.clientAssertion = $result.value
39+
}
3540
New-BcAuthContext `
3641
-clientID $bcAuthContext.clientID `
3742
-tenantID $bcAuthContext.tenantID `

ReleaseNotes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
6.0.30
22
Issue 3762 Give Option to Choose SQL PowerShell Module When Restoring From BacPac
33
There are instances where sqlps does not work as expected when it is installed. This change adds a switch parameter, useSqlServerModule, to Restore-BcDatabaseFromArtifacts, New-NavContainer, and the BcContainerHelper config file.
4+
Issue 1303 from AL-Go repository - renew federated token when access token needs renewal (works only for GitHub at this time)
45

56
6.0.29
67
Issue 3591 When using Publish-NAVApp to publish an app, which fails compilation in the service, the command might hang forever - the fix for this is a temporary hack put in place for the versions which doesn't work.

0 commit comments

Comments
 (0)