I was trying to build the console app using the code but kept getting errors like this:
: AADSTS900023: Specified tenant identifier 'token' is neither a valid DNS name, nor a valid external domain.
It turns out the AuthenticationContext doesn't need to have the "/oauth2/token" part. After taking off that, the code works:
new AuthenticationContext("https://login.windows.net/" + tenantDomain;
I was trying to build the console app using the code but kept getting errors like this: : AADSTS900023: Specified tenant identifier 'token' is neither a valid DNS name, nor a valid external domain.
It turns out the AuthenticationContext doesn't need to have the "/oauth2/token" part. After taking off that, the code works:
new AuthenticationContext("https://login.windows.net/" + tenantDomain;