Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Validate an existing username and password against azure active directory

$
0
0

I have a WCF service that is currently being passed in a username and password, is there a way I can validate these credentials against my sample azure active directory user list ?

Im currently trying the following , but it just returns bad request. could someone point me in the right direction

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(String.Format(StringConstants.AzureADSTSURL, tenantName));
            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            string postData = "grant_type=password";
            postData += "&resource=" + HttpUtility.UrlEncode(StringConstants.GraphPrincipalId);
            postData += "&client_id=" + HttpUtility.UrlEncode(appPrincipalId);
            postData += "&username=" + HttpUtility.UrlEncode("UserName");
            postData += "&client_secret=" + HttpUtility.UrlEncode(secret);
            postData += "&password=" + HttpUtility.UrlEncode("Userpassword");

 


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>