<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00006yRhGgSAKOkta Classic EngineIntegrationsAnswered2023-05-30T19:51:46.000Z2019-11-08T15:01:21.000Z2019-11-27T21:00:31.000Z

ZachG.53641 (Customer) asked a question.

My "Trusted application" keeps getting 401 Unauthorized on API requests

I'm developing locally, I have my API key in the header of my request, my public IP address has been white-listed.. I'm able to make three or four requests to the API with successful responses (whether the request is Authentication, Create User, Add User to Group, etc) but at some point the API blocks me out, returning all requests with 401 Unauthorized for who knows how many hours.

All my requests have this setup:

 

var request = (HttpWebRequest)WebRequest.Create(oktaAPI + endpoint);

      request.Method = method;

      request.KeepAlive = true;

      request.ContentType = "application/json";

      request.Accept = "application/json";

      request.Headers.Add("cache-control", "no-cache");

      request.Headers.Add("Authorization", "SSWS " + oktaKey);

 

Some of my requests also add the X-Forwarded-For header.

 

What am I doing wrong? The only thing I have not tried is getting a deviceToken for the trusted application and that's because I just can't figure out how to do that.


This question is closed.
Loading
My "Trusted application" keeps getting 401 Unauthorized on API requests