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://.com/authentication";
ClientCredential obj = new ClientCredential(userName, password);
AuthenticationResult result = null;
result = authContext.AcquireToken(url, obj);
}
catch (Exception ex)
{ }
}