簡體   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). 但是,如果不使用 Microsoft 自己的登錄頁面,我找不到一種對用戶進行身份驗證的好方法。 我不想用那個。

那么有沒有一種方法可以驗證用戶名和密碼,並獲得 boolean 作為回報? ASP.NET 核心 MVC web 應用程序使用 C#。

官方允許使用email和密碼登錄,但不推薦。 為安全起見,請在使用后自行評估。

您可以先閱讀官方文檔 而從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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM