I’m very new to Okta (< 1 week) and I’m trying to incorporate Okta into an existing MVC.Net application that does not have any current authentication mechanism.
I’m currently trying to use the Okta Authentication API and the Session API – although I’m open to other ways if there’s a better/easier way.
I can authenticate a username / password and I get back a valid sessionToken but I cannot seem to create a session with that token.
If I try the Session API (below), it works in Postman but I get back an error E0000003 using the code below.
var client = new RestClient(baseUri + "/api/v1/sessions?additionalFields=cookieToken");
var request = new RestRequest(Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddHeader("Authorization", apiToken);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
var str = String.Format("{{ \"sessionToken\" : \"{0}\" }}", sessionToken);
request.AddJsonBody(str);
var resp = client.Execute(request);
What am I missing?