Learning the Okta API
This article is a work-in-progress and, hopefully, the first in a series as we learn more about implementing the Okta API.
In my role at my company, I do mostly system architecture but, on the side, play around with prototypes and build out proof of concept models.
So, primarily, I’ve recently been developing the solution for incorporating Okta into a user role management implementation for an enterprise application on behalf of our client and, supportive of that, have been doing some of my own building to better learn the Okta API. The knowledge I gain from this exercise, I will pass to our team of developers.
Please understand that any code that I share here is certainly not production-ready. And any knowledge may be replaced by learning that I gain as my discovery continues. But, I figured that I would document the journey here to reinforce my own learning and to be a resource — insomuch that it can be — to any other Okta users.
In my current project, I’m using .NET Core 3.0. On the front end, I have a basic React 16.8 client application.
The basic approach that I am taking to learn the Okta API is to:
- Review the docs.
- Practice with the Okta API in Postman.
- Implement the learning from Postman in my .NET solution.
- Call the Okta API via my backend solution using fetch() in React.
Our corporate client has provided me with an Okta Admin account. From there, I was able to generate for myself an access token to authorize use of the API. These are steps that you will have to take to participate in the code that follows.
You can download the Okta SDK from NuGet in Visual Studio.
Once you do that, instantiating the Okta client in your solution is simple:

You can use whatever is your preferred safekeeping technique to store and invoke your secure token. And then call them here.
Once instantiated, the Okta Users API is intuitive and provides semantic responses. That includes model validation. So, for example, if you submit a user that is missing a required field, the Okta API Exception response describes what’s missing (or, for another example, that an email isn’t formatted accurately).
This is super rough and for testing only, but I was able to throw together a method that creates a client in the user store without much headache.

Keeping in mind that our UI is currently just a means to test the API, check out the example of a validation error provided by the Okta API Exception interface in the gif below:

And, an example of the user being added to the store (it isn’t much to see from this view):

The actual user object from Okta looks like this example (taken from the Okta docs):

That’s it for now. More to follow as my experience with the Okta API increases. I hope this may be helpful, or at least nerdy entertainment :) Thanks for reading.
You can follow me on twitter:
And on Instagram: