Skip to content

Commit

Permalink
fix accesstoken type (#3211)
Browse files Browse the repository at this point in the history
Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk committed Oct 18, 2023
1 parent c95dedf commit 92311ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
16 changes: 10 additions & 6 deletions AzureAD/New-AadAppsForBc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,20 @@ try {
if ($jwtToken.aud -ne 'https://graph.microsoft.com') {
Write-Host -ForegroundColor Yellow "The accesstoken was provided for $($jwtToken.aud), should have been for https://graph.microsoft.com"
}
Connect-MgGraph -AccessToken $bcAuthContext.accessToken | Out-Null
$accessToken = $bcAuthContext.accessToken
}
else {
if ($accessToken) {
Connect-MgGraph -accessToken $accessToken | Out-Null
if ($accessToken) {
try {
# Connect-MgGraph changed type of accesstoken parameter from plain text to securestring along the way
Connect-MgGraph -accessToken (ConvertTo-SecureString -String $accessToken -AsPlainText -Force) | Out-Null
}
else {
Connect-MgGraph -Scopes 'Application.ReadWrite.All' | Out-Null
catch [System.ArgumentException] {
Connect-MgGraph -accessToken $accessToken | Out-Null
}
}
else {
Connect-MgGraph -Scopes 'Application.ReadWrite.All' | Out-Null
}
}
$account = Get-MgContext

Expand Down
3 changes: 3 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
6.0.1
New-AadAppsForBC doesn't work with the newer versions of Microsoft.Graph module (where the type of the accesstoken parameter has changed)

6.0.0
Add parameter -accept_insiderEULA on New-BcContainer, Get-BcArtifactUrl and Run-AlPipeline to accept the insider EULA (https://go.microsoft.com/fwlink/?linkid=2245051) instead of using the insider SAS token.
The insider SAS token is still supported until April 2024 where the last insider SAS token will expire...
Expand Down
2 changes: 1 addition & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-dev
6.0.1-dev

0 comments on commit 92311ff

Please sign in to comment.