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)
{ }
}
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)
{ }
}