如何创建Azure Web应用程序以对用户进行身份验证并获取其访问令牌? [英] How can I create a Azure Web Application to authenticate User and acquire its Access Token?

查看:57
本文介绍了如何创建Azure Web应用程序以对用户进行身份验证并获取其访问令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Azure Web应用程序,当通过Azure AD凭据打开Web应用程序链接时,可以对外部/内部(来自任何组织)用户进行身份验证,并获取其访问令牌.

I want to create an Azure Web Application that can authenticate an external/internal (from any Organization) user upon opening the Web Application link through Azure AD Credentials and acquire its Access token in return.

我想使用该访问令牌以编程方式在用户的租户中创建应用程序注册.

I want to use that Access Token to programmatically create an application registration in User's tenant.

推荐答案

首先,您需要身份验证代码流来对用户并获得访问令牌.

First, you need to register an application and set it as a multi-tenant application, then use the auth code flow to authenticate the user and obtain an access token.

接下来,您需要使用访问令牌来调用

Next, you need to use the access token to call the MS graph api to create an application, because you are using the auth code flow to obtain the token, so you need to grant delegation permissions to the application.

请参阅:样本.

这篇关于如何创建Azure Web应用程序以对用户进行身份验证并获取其访问令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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