You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get AAD access token from Azure and i am getting WaitingForActivation message.. Am i doing something wrong.. Please help ... Thanks in Advance !!
string clientId = "Client Application ID";
string aadAudience = "https://login.microsoftonline.com/{Tanent ID}/oauth2/token";
var authCtx = new AuthenticationContext(authority);
// Load certificate from Disk
X509Certificate2 clientCert = new X509Certificate2(certificateLocation, certificatePassword);
var clientAssertion = new ClientAssertionCertificate(clientId, clientCert);
var authenticationResult = await authCtx.AcquireTokenAsync(aadAudience, clientAssertion);
if (authenticationResult == null)
{
throw new InvalidOperationException("Failed to obtain the token");
}
// contains the token
string accessToken = authenticationResult.AccessToken;
return accessToken;
}
The text was updated successfully, but these errors were encountered:
I am trying to get AAD access token from Azure and i am getting WaitingForActivation message.. Am i doing something wrong.. Please help ... Thanks in Advance !!
public static async Task getAcccessTockenMs( string certificateLocation, string certificatePassword)
{
// AAD Instance
string authority = "https://login.microsoftonline.com/{Tanent ID}";
The text was updated successfully, but these errors were encountered: