.NET SDK AuthClient.Authenticate issue Skip to main content
https://support.okta.com/help/answers?id=9062a000000bmpeqay&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Chin BaeChin Bae 

.NET SDK AuthClient.Authenticate issue

It seems like calling AuthClient.Authenticate() changes the context of all API method calls to that of the user. So other API calls throw exceptions due to HTTP forbidden responses from the server.
 
var apikey = "somekey";
var env = "https://dev-999999.oktapreview.com";
var username = "user@company.com";
var pwd = "somepwd";

var oktaClient = new OktaClient(apikey, new Uri(env));

var authClient = oktaClient.GetAuthClient();
var result = authClient.Authenticate(username, pwd); //On 2nd try comment this out. There will be no exception
var appClient = oktaClient.GetAppsClient();
var applist = appClient.GetList(); //throws exception if AuthClient.Authenticate() is called
If this is by design, is there a way to do a user challenge without authenticating? My goal is challenge the user and then check if the user has access rights to the application. There's no way to do this if all calls subsequent to AuthClient.Authenticate() throw exceptions.