I am trying to implement a call to an existing Azure Service using ConfidentialClientApplicationBuilder in Blazor WASM. I am getting an 'Operation is not supported on this platform.' error when I try to get a Token using the ExecuteAsync() command. Is there another way to get a token or a way to get past the ExecuteAsync() command?
private async Task<string> GetToken()
{
var app = ConfidentialClientApplicationBuilder.Create(ClientId)
.WithClientSecret(ClientSecret)
.WithAuthority(new Uri(AADInstance+"/"+Tenant))
.Build();
string[] scopes = new string[] { AADInstance + ".default" };
AuthenticationResult result = null;
try{
AcquireTokenForClientParameterBuilder builderResult = app.AcquireTokenForClient(scopes);
var token = await builderResult.ExecuteAsync();
}
}