简体   繁体   English

有没有办法使用 Azure AD 对 ASP.NET Core MVC web 应用程序中的用户进行身份验证,但使用您自己的登录页面,而不是使用 Microsoft 的登录门户

[英]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.

相关问题 ASP NET API - 使用 Azure AD SAML 协议验证用户,无需打开 Microsoft 登录页面 - ASP NET API - Authenticate users using Azure AD SAML Protocol without open Microsoft Login Page 我无法使用 asp.net 身份验证登录 asp.net mvc5 的用户 - I am failing to authenticate users on login in asp.net mvc5 using asp.net identity 使用带有Client Secret的Azure AD对asp.net核心后端进行身份验证 - Authenticate Native App with asp.net core Backend using Azure AD with Client Secret 让用户选择在 MVC5 应用中使用本地表单登录或 Microsoft 365 外部登录进行身份验证 - Let users choose to authenticate using local forms login or Microsoft 365 external login in a MVC5 app 带有 ASP.NET 内核 (MVC) 的登录页面 - Login Page with ASP.NET Core (MVC) 手动将用户从 ASP .NET Core API 重定向到 Microsoft Azure AD 登录页面 - Redirect user to Microsoft Azure AD Login Page from ASP .NET Core API manually ASP.NET web 页面通过请求在 Azure AD 中进行身份验证 - ASP.NET web page authenticate in Azure AD by request 使用ADAL.net来验证Azure AD凭据的自定义Web应用程序登录页面 - Custom web app login page using ADAL.net to validate Azure AD credentials 使用 Azure AD 在 .net 核心应用程序 (Blazor) 中对用户进行身份验证 - Using Azure AD to authenticate users in a .net core application (Blazor) ASP.NET (6.0) Core MVC Login and Registration using Identity - ASP.NET (6.0) Core MVC Login and Registration using Identity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM