【发布时间】:2015-06-30 06:06:48
【问题描述】:
我有一个多租户应用程序,对于一个单独的本机应用程序,我正在尝试实现NativeClient-Headless-DotNet 描述的类似方法。当我有我的多租户应用程序时,它按预期工作,然后我在 Azure AD 中设置本机客户端应用程序,我将权限添加到 mWeb 应用程序。发出的请求如下所示:
POST https://login.microsoftonline.com/{my tenant id}/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
return-client-request-id: true
x-client-SKU: .NET
x-client-Ver: 2.14.0.0
x-client-CPU: x64
x-client-OS: Microsoft Windows NT 6.2.9200.0
x-client-last-response-time: 239
x-client-last-endpoint: user_realm
Host: login.microsoftonline.com
Content-Length: 173
Expect: 100-continue
resource={my web app uri id}&client_id={my native client app id}&grant_type=password&username={my username}&password={my password}&scope=openid
非常适合这个原型。我想看看我是否可以在不需要在 Azure AD 中注册本机客户端应用程序的情况下脱身。为此,如果我们假设我可以安全地将用户名和密码传递给我的 Web 应用程序,有没有办法从我的 Web 应用程序而不是我的本机客户端应用程序请求一些资源,它会返回类似于上述请求的响应的响应?比如:
POST https://login.microsoftonline.com/{my tenant id}/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
return-client-request-id: true
x-client-SKU: .NET
x-client-Ver: 2.14.0.0
x-client-CPU: x64
x-client-OS: Microsoft Windows NT 6.2.9200.0
x-client-last-response-time: 239
x-client-last-endpoint: user_realm
Host: login.microsoftonline.com
Content-Length: 173
Expect: 100-continue
resource={some resource that requires authentication}&client_id={my web app id}&grant_type=password&username={my username}&password={my password}&scope=openid
Azure AD 中有哪些可用的功能?例如,我可以请求 Grap API 令牌,但这需要 client_secret 因为它访问整个目录。我正在寻找可能通过传递用户名和密码来工作的特定配置文件。谢谢。
【问题讨论】:
标签: authentication oauth-2.0 openid azure-active-directory