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

Azure Login

$
0
0
Hi ........!
i need a little help i have register a Application in Azure Active Directory now i want to log in a user with resource and client  credentials i do not want to add client Id how can i log in the user .......?
i am using the following code  having Exception "Object reference not set to an instance of an object." 
How can i solve it any suggestions ......?

  private AuthenticationContext authContext;
        public  void button1_Click(object sender, EventArgs e)
        {
            try
            {
               string userName = "USERNAME";
               string password = "PASSWORD";

               
                string url = "https://xyz.com/authentication";

                ClientCredential obj = new ClientCredential(userName, password);
               
                AuthenticationResult result = null;

                result = authContext.AcquireToken(url, obj);
             
            }
            catch (Exception ex)
            { }

        } 

Viewing all articles
Browse latest Browse all 16000

Trending Articles



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