Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate azure active directory user credentials?

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.

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

like image 750
mohamed_ismail Avatar asked Apr 22 '13 07:04

mohamed_ismail


2 Answers

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);

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

like image 87
user3493833 Avatar answered Oct 27 '22 10:10

user3493833


Ah, I think, you're trying to implement a SSO scenario. Try Adding Sign-On to Your Web Application Using Windows Azure AD! And if your customer does not have an Azure subscription, this Multi-Tenant Cloud Application for Windows Azure Active Directory sample describes the details with using Azure Active Directory Authentication Library. Hope this helps.

like image 24
attila Avatar answered Oct 27 '22 08:10

attila