本文介绍了如何验证 Azure Active Directory 用户凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 azure 活动目录中有一组用户;在我的程序中,我将收集最终用户的用户名和密码,并希望检查 windows azure 活动目录.

I have a set of users in azure active directory; in my program I will collect the user name and password of an end user, and want to check against windows azure active directory.

有可能吗?请提供一些参考.

Is it possible? Please provide some reference.

我知道我们可以使用 Power-shell cmdlet 进行验证;我想知道是否还有其他方法可以验证用户凭据.

I know we can validate using Power-shell cmdlets; I want to know if there is any other way to validate user credentials.

推荐答案

以防有人仍在寻找答案.通过向 AcquireToken 的重载函数提供 UserCredential 类的对象,在 ADAL 版本 2.7.10707.1513-rc 中添加了无需为用户凭据打开新窗口即​​可对用户进行身份验证的支持.

In case someone is still looking for an answer.Support for authenticating user without opening a new window for user cred was added in ADAL version 2.7.10707.1513-rc through providing an object of class UserCredential to an overloaded function of AcquireToken.

public AuthenticationResult AcquireToken(string resource, string clientId, UserCredential userCredential);

这是 powershell 的示例代码.$UserCred = 新对象 Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential("****@*****", "*****")$result = $AuthContext.AcquireToken($resource,$clientID,$UserCred)

Here is a sample code for powershell.$UserCred = new-object Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential("****@*****", "*****")$result = $AuthContext.AcquireToken($resource,$clientID,$UserCred)

这篇关于如何验证 Azure Active Directory 用户凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 18:38