Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown user type while using AcquireTokenAsync with UserCredential

I used AcquireTokenAsync for authenticating with Azure Active directory.

below is the code

var uc = new UserCredential(username, password);
var s =  var s = await authenticationContext.AcquireTokenAsync("https://graph.windows.net", _clientId, uc);

the problem is that when I run the code, I get

"unknown_user_type: Unknown User Type"

like image 629
Milad Shahbazi Avatar asked Oct 25 '25 03:10

Milad Shahbazi


1 Answers

Usually, this would indicate that the user you are attempting to sign-in with is not a user whose account is mastered in the tenant whose authority was passed in to the ADAL constructor. This can happen if the authority passed is the pseudo tenant 'common', or if the user is a guest account. Many times the user ends up being an MSA account that is a guest in the desired account. Try using an account that is an AAD account mastered in that particular tenant.

like image 51
Rich Randall Avatar answered Oct 27 '25 19:10

Rich Randall