简体   繁体   English

在 Azure 集成 ASP.NET 核心 MVC 应用程序中获取访问令牌

[英]Get the access token in an Azure integrated ASP.NET Core MVC application

We have the following requirements我们有以下要求

  1. Create an ASP.NET Core 3.1 MVC web application创建 ASP.NET Core 3.1 MVC web 应用程序
  2. Add application registration添加应用注册
  3. Integrate Azure authentication for login and logout集成Azure认证登录和注销
  4. Get the access token to call other APIs获取访问令牌以调用其他 API

We have done 1 and 2 they are very straight forward.我们已经完成了 1 和 2,它们非常直接。

We need guidance on how to get the access token,我们需要有关如何获取访问令牌的指导,

  1. Can we get the access token during the login process itself?我们可以在登录过程中获取访问令牌吗?
  2. If not is there are any oob way of getting the access token after the login process.如果没有,在登录过程后是否有任何 oob 方式获取访问令牌。 Thought it would be simple enough.认为它会很简单。

Thank you.谢谢你。

To get a token, you need to authenticate the user with a known account in an Azure Active Directory.要获取令牌,您需要使用 Azure Active Directory 中的已知帐户对用户进行身份验证。 Look at app registrations and using single sign-on.查看应用注册并使用单点登录。 The user will be redirected to a login page that will authenticate the user and send back the token.用户将被重定向到登录页面,该页面将对用户进行身份验证并发回令牌。

https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-application-management https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-application-management

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 asp.net mvc 从 azure 获取访问令牌 - How to get the access token from azure using asp.net mvc asp.net core 2 mvc获取应用程序版本 - asp.net core 2 mvc get application version Azure中的ASP.NET MVC Core应用 - ASP.NET MVC Core app in Azure 在asp.net core mvc中通过refresh_token无声更新access_token - Silent renew access_token via refresh_token in asp.net core mvc 如何在ASP.NET Core中为Azure AD请求正确的访问令牌以访问Microsoft Graph - How do request a correct access token in ASP.NET Core for Azure AD to access Microsoft Graph 有没有办法使用 Azure AD 令牌对 ASP.NET Core MVC controller 操作进行身份验证? - Is there a way to authenticate an ASP.NET Core MVC controller action using an Azure AD token? 通过SQL Server依赖注入刷新ASP.NET Core中的Azure Active Directory访问令牌 - Refreshing Azure Active Directory access token in ASP.NET Core with dependency injection for SQL Database 如何在 ASP.NET Core API 中查看 Azure AD 生成的访问令牌? - How to view access token generated by Azure AD in ASP.NET Core API? Azure ASP.NET 核心 MVC WebApp 的 AD 身份验证 - 如何自定义应用程序的 Redirect_URI! 发送 - Azure AD Authentication for ASP.NET Core MVC WebApp - how to customize the Redirect_URI the APPLICATION! sends 如何在 ASP.NET Core MVC 中获取令牌的值 - How to fetch the value of token in ASP.NET Core MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM