问题描述
我在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中添加了对用户身份验证的支持,而无需为用户cred打开新窗口.
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 = new-object 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用户凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!