Following is the code written for getting access token from azure AD.
AuthenticationContext authenticationContext = new AuthenticationContext(Constants.AuthString, false);
// Config for OAuth client credentials
ClientCredential clientCred = new ClientCredential(Constants.ClientId, Constants.ClientSecret);
Task<AuthenticationResult> authenticationResult = authenticationContext.AcquireTokenAsync(Constants.ResourceUrl,
clientCred);
AuthenticationResult x = await authenticationResult;
string token = x.AccessToken;
Getting the status as 'Waiting for activation' and error at the below line.
AuthenticationResult x = await authenticationResult;
What is wrong with this? How to check a user existence in azure AD?