久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

通過 Azure Functions 在 Azure AD 中驗(yàn)證用戶(驗(yàn)證用戶

Authenticate User In Azure AD (validate username amp; password) via Azure Functions(通過 Azure Functions 在 Azure AD 中驗(yàn)證用戶(驗(yàn)證用戶名和密碼))
本文介紹了通過 Azure Functions 在 Azure AD 中驗(yàn)證用戶(驗(yàn)證用戶名和密碼)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號(hào)..

是否可以創(chuàng)建一個(gè) Azure 函數(shù),它將用戶名和密碼作為輸入?yún)?shù),并且函數(shù)應(yīng)該針對(duì) Azure AD 驗(yàn)證用戶.

Is it possible to create an Azure Function which will take username and password as input parameters and function should validate user against Azure AD.

推薦答案

首先,重要的是要提到收集 Azure AD 用戶的用戶名和密碼作為應(yīng)用程序(Azure 函數(shù)或 Web 應(yīng)用程序)的一部分,你是開發(fā))非常違反最佳實(shí)踐,并帶來(lái)多種攻擊風(fēng)險(xiǎn).因此,即使您可以使用變通方法來(lái)實(shí)現(xiàn)它,請(qǐng)務(wù)必從安全角度重新考慮您的要求.

Firstly, it's important to mention that collecting username and password for an Azure AD user as part of your application (Azure function or web app any other application you're developing) is very much against the best practices and opens up multiple attack risks. So even though you may be able to use workarounds to achieve it, please do reconsider the requirement that you have from a security standpoint.

解決方法 - ROPC - 資源所有者密碼憑據(jù)授予(不推薦,多個(gè)問題)

Azure AD 不提供直接 API 來(lái)驗(yàn)證用戶憑據(jù).作為一種解決方法(也是一個(gè)不好的解決方法),您可以使用 Resource Owner Password Credentials (ROPC) flow,它與用戶名和密碼一起使用來(lái)獲取令牌.

Azure AD does not provide a direct API to validate user credentials. As a workaround (and a bad one at that), you can use Resource Owner Password Credentials (ROPC) flow which works with username and password to acquire a token.

它違反了安全最佳實(shí)踐,也不適用于 MFA 和聯(lián)合身份驗(yàn)證用戶.強(qiáng)烈建議不要使用此授權(quán),因?yàn)樗鼤?huì)帶來(lái)潛在的攻擊風(fēng)險(xiǎn),因此不推薦.

It violates security best practices and also does not work with MFA and federated authentication users. Using this grant is highly discouraged as it brings potential attack risks, so not recommended.

如果用戶名或密碼不正確,你會(huì)得到一個(gè)異常,否則你會(huì)得到一個(gè)有效的令牌,這意味著憑據(jù)是好的.

If either username or password is incorrect, you will get an exception, otherwise you get back a valid token which means credentials are good.

這里有幾個(gè)鏈接,其中包含有關(guān) ROPC 的詳細(xì)信息(建議不要同時(shí)使用它..):

Here are a couple of links that cover details on ROPC (and recommend not using it at the same time..):

  • ADAL.NET 庫(kù)文檔關(guān)于使用用戶名和密碼獲取令牌
  • Azure AD OAuth 中的資源所有者密碼憑據(jù)授予

例如,本機(jī)應(yīng)用程序的代碼如下所示.

For example, code would look like this for a native application.

result = await context.AcquireTokenAsync(resource, clientId, new UserPasswordCredential("john@contoso.com", johnsPassword));

其他參考資料

  • 這里 是一篇舊文章,但仍然非常詳細(xì).看看最后的一長(zhǎng)串限制.
  • Here is an old article but still very detailed. And look at the long list of limitations at the end.

這篇關(guān)于通過 Azure Functions 在 Azure AD 中驗(yàn)證用戶(驗(yàn)證用戶名和密碼)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進(jìn)行身份驗(yàn)證并跨請(qǐng)求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權(quán)不起作用)
ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護(hù)進(jìn)程或服務(wù)器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發(fā)技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調(diào)用時(shí) Azure KeyVault Active Directory AcquireTokenAsync 超時(shí))
主站蜘蛛池模板: 日韩欧美操 | 伊人网站 | 自拍偷拍第1页 | 操久久 | 成人亚洲精品久久久久软件 | 中文字幕免费在线 | 日韩欧美理论片 | 欧美一级在线 | 伊人一区 | 伊人久久成人 | 亚洲精品免费在线 | 久久久久久女 | 欧美一级三级在线观看 | 欧美色综合一区二区三区 | 色约约视频 | 精品成人 | 国产一区二区三区四区五区3d | 欧美日韩在线免费观看 | 中文字幕一区二区三区在线观看 | 婷婷二区 | 欧美日韩在线一区二区三区 | 亚洲一区二区av在线 | 亚洲av毛片成人精品 | 中文字幕av一区二区三区 | 欧产日产国产精品视频 | 性生生活大片免费看视频 | 久久久久无码国产精品一区 | 一区二区日韩 | 真人一级毛片 | 久久久女女女女999久久 | 91黄在线观看 | 欧美三级免费观看 | 波多野结衣一区二区三区在线观看 | 午夜一区 | 日韩一区二区三区在线观看 | 国产一区二区在线视频 | www.中文字幕 | 亚洲一二三在线观看 | 久久成人免费视频 | 天天干天天干 | 色999日韩 |