[英]Is there a way to authenticate users in an ASP.NET Core MVC web app using Azure AD, but with a your own login page, not using Microsoft’s login portal
I'm trying to make my own login page for an ASP.NET Core MVC web app using Azure AD (not Azure AD B2C). I'm trying to make my own login page for an ASP.NET Core MVC web app using Azure AD (not Azure AD B2C). But I can't find a good way to authenticate a user without using Microsoft's own login page.但是,如果不使用 Microsoft 自己的登录页面,我找不到一种对用户进行身份验证的好方法。 I don't want to use that.我不想用那个。
So is there a way I can authenticate the username and the password, and get a boolean in return?那么有没有一种方法可以验证用户名和密码,并获得 boolean 作为回报? The ASP.NET Core MVC web app uses C#. ASP.NET 核心 MVC web 应用程序使用 C#。
The use of email and password is officially allowed to log in, but it's not recommended.官方允许使用email和密码登录,但不推荐。 For safety reasons, please evaluate your own after use.为安全起见,请在使用后自行评估。
You can read official doc first .您可以先阅读官方文档。 And from the http request details, we can find it support username and password to log in.而从http请求详情中,我们可以发现它支持用户名和密码登录。
// Line breaks and spaces are for legibility only. This is a public client, so no secret is required.
POST {tenant}/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&scope=user.read%20openid%20profile%20offline_access
&username=MyUsername@myTenant.com
&password=SuperS3cret
&grant_type=password
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.