我想在 Azure AD 中replyUrlsWithType的应用程序清单上以编程方式设置。但是,用于更新清单的 REST API似乎只支持设置 replyUrls 属性,而不能设置 type 属性。是否有支持以replyUrlsWithType编程方式设置的方法?
我正在与之合作的团队使用 Fiddler 来查看 Azure 门户如何设置类型属性,并修改了以下内容以使其工作,但我们正在寻找一种受支持的方法(如果有的话):
$UpdateAppResponse = Invoke-WebRequest -Uri "https://graph.windows.net/myorganization/applications/$appId?api-version=2.0" `
-Method "PATCH" `
-Headers @{"Authorization"="$($Response.token_type) $($Response.access_token)"; "Accept"="*/*"; } `
-ContentType "application/json" `
-Body "{`"id`":`"$appId`",`"replyUrlsWithType`":[{`"url`":`"https://$HostName`",`"type`":`"Web`"},{`"url`":`"msauth://$ReversedHostName`",`"type`":`"InstalledClient`"}, {`"url`":`"msauth.$ReversedHostName://auth`",`"type`":`"InstalledClient`"}]}"
Run Code Online (Sandbox Code Playgroud) 我熟悉在 Az CLI 中请求令牌——az account get-access-token --resource-type ms-graph | ConvertFrom-Json但我需要从 Azure PowerShell 获取令牌。我知道您可以通过以下方式请求 REST API 令牌
$currentAzureContext = Get-AzContext
$profileClient = New-Object Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient([Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile);
$UserToken = $profileClient.AcquireAccessToken($currentAzureContext.Subscription.TenantId).AccessToken;
Run Code Online (Sandbox Code Playgroud)
但同样,我需要一个 Graph 访问令牌。有没有办法做到这一点?