At first, you need to create a user credential:
UserCredential uc = new UserCredential(user, password);
After that, you need to call AcquireToken() function using that user credential:
public AuthenticationResult AcquireToken(string resource, string clientId, UserCredential userCredential);
public Task<AuthenticationResult> AcquireTokenAsync(string resource, string clientId, UserCredential userCredential);
I hope this will work.
Want to become an Azure expert? Join Microsoft Azure Training now!!
Want to know more about Azure active directory? Watch this video on Azure Active Directory :