如何以编程方式指定replyUrlsWithType [英] How to specify replyUrlsWithType programmatically

查看:120
本文介绍了如何以编程方式指定replyUrlsWithType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式在应用程序replyUrlsWithType "nofollow noreferrer">清单在Azure AD中.但是,用于更新

I want to set the replyUrlsWithType programmatically on an app manifest within Azure AD. However, the REST API for updating the manifest only seems to support setting the replyUrls property, which does not enable the type property to be set. Is there a supported way to set the replyUrlsWithType programmatically?

我正在与之合作的团队使用Fiddler来研究Azure门户如何设置type属性,并破解了以下内容以使其起作用,但如果有一种方法,我们正在寻找一种受支持的方法:

The team I'm working with has used Fiddler to take a look at how the Azure portal sets the type property and have hacked the following to get it to work, but we are looking for a supported method if there is one:

$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`"}]}"

推荐答案

过去,在Azure门户中注册的应用程序只能是一种类型.因此,Azure AD Graph API能够设置replyUrls.

In the past, the application registered in Azure portal could only be one type. So, the Azure AD Graph API was able to set replyUrls.

但是,在Azure门户中注册的新应用程序可以同时支持两种类型.基于提琴手的痕迹,Azure AD Graph似乎已更新以支持该功能.

However, new application registered in Azure portal could support both type at the same time. Based on the fiddler traces, the Azure AD Graph seems to updated to support that.

URL https://graph.windows.net/myorganization/applications/$appId?api-version=2.0是AAD Graph API的典型URL.也许只是文档尚未更新.

The url https://graph.windows.net/myorganization/applications/$appId?api-version=2.0 is a typical url of AAD Graph API. Maybe just the document has not been updated.

但是,我们建议您使用 Microsoft Graph API .它是用于管理大量Microsoft Cloud资源的统一中心.

However, we suggest you use Microsoft Graph API. It is an unified center for managing lots of Microsoft Cloud Resources.

您可以获取应用程序更新应用程序使用Microsoft Graph API.

You can Get application and Update application with Microsoft Graph API.

例如,您可以使用以下正文提出PATCH请求:

For example, you can make a PATCH request with the following body:

{
    "publicClient": {
        "redirectUris": [
            "myapp://auth"
        ]
    },
    "web": {
        "redirectUris": [
            "https://devchat.com/",
            "http://localhost/",
            "https://mytest.com/"
        ],
        "implicitGrantSettings": {
            "enableAccessTokenIssuance": false,
            "enableIdTokenIssuance": false
        }
    }
}

然后将添加所有平台:

这篇关于如何以编程方式指定replyUrlsWithType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆