Hi everyone,
I am trying to use Okta.Auth.Sdk in one of my controller to get SessionID. I create request as in example but when I call client.AuthenticateAsync nothing happened, as appliction wait for response but never came up. I try this exactly example on some test console application and its work fine. Is there any problem to this sdk work fine in MVC?
This example of that function that I create
public async Task AuthenticationClientAsync()
{
try
{
var client = new AuthenticationClient(new OktaClientConfiguration
{
OktaDomain = "https://dev-23*****.okta.com",
});
var authnOptions = new AuthenticateOptions()
{
Username = $"djordje******@****.com",
Password = "**********",
};
var authnResponse = await client.AuthenticateAsync(authnOptions);
return authnResponse.SessionToken;
}
catch (AggregateException aex)
{
throw;
}
catch (Exception aex)
{
throw;
}
}