Skip to content

Commit

Permalink
issue 3613 (#3614)
Browse files Browse the repository at this point in the history
Fixes #3613

---------

Co-authored-by: freddydk <freddydk@users.noreply.github.com>
freddydk and freddydk authored Aug 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e60f951 commit 52ddaa4
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Auth/New-BcAuthContext.ps1
Original file line number Diff line number Diff line change
@@ -246,7 +246,7 @@ try {
$accessToken = ""
$userCode = ""
$message = ""
$cnt = 0
$interval = 5

if ($deviceCode -eq "") {
$DeviceCodeRequestParams = @{
@@ -262,10 +262,11 @@ try {
Write-Host "Attempting authentication to $Scopes using device login..."
$DeviceCodeRequest = Invoke-RestMethod @DeviceCodeRequestParams -UseBasicParsing
Write-Host $DeviceCodeRequest.message -ForegroundColor Yellow
Write-Host -NoNewline "Waiting for authentication"
$deviceCode = $DeviceCodeRequest.device_code
$userCode = $DeviceCodeRequest.user_code
$interval = $DeviceCodeRequest.interval
$message = $DeviceCodeRequest.message
Write-Host -NoNewline "Waiting for authentication (interval=$interval)"
}

$TokenRequestParams = @{
@@ -280,7 +281,7 @@ try {
}

while ($accessToken -eq "" -and ([DateTime]::Now.Subtract($deviceLoginStart) -lt $deviceLoginTimeout)) {
Start-Sleep -Seconds 1
Start-Sleep -Seconds $interval
try {
$TokenRequest = Invoke-RestMethod @TokenRequestParams -UseBasicParsing
$accessToken = $TokenRequest.access_token
@@ -308,9 +309,7 @@ try {
throw $errorRecord
}
elseif ($err -eq "authorization_pending") {
if ($cnt++ % 5 -eq 0) {
Write-Host -NoNewline "."
}
Write-Host -NoNewline "."
}
else {
Write-Host
1 change: 1 addition & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
6.0.21
Issue 3613 aka.ms/getbc fallback to NAVUserPassword because token expired when setting up SSO
Issue #3617 Regression File Newtonsoft.Json.dll not found when copying item for New-BcCompilerFolder

6.0.20

0 comments on commit 52ddaa4

Please sign in to comment.