I created an Okta account, generated an API Token on the dev site and tried to add a user or get a list of users.
With the .NET Okta.Sdk I get the error ‘Invalid Token Provided’ every time, but with Postman I got a little further obtaining a long HTML response (558 KB) that basically says “Page not found”.
Here’s a simple command tat I use for getting a list of users (I replaced the api token):
Please help me add users to Okta because we have existing customers who want to migrate to this solution and I already changed our software to use the Okta Authentication.
I’ve read somewhere that I should ignore “{{your-okta-tenant}}”, so I did. At least this way I’m not getting a direct error, but the response is still incorrect.
I’m generating the API token on https://dev-48184511-admin.okta.com/admin/access/api/tokens
my user is Super Admin, the last token that I used was generated 2 days ago (although it seems strange that it has the same datetime in the Created and Expires fields).
I’m wondering what you mean by " * Make sure you generate the token from the same okta tenant you are hitting the endpoint". I have a single Okta trial account.
I noticed that if I specify in Postman in the Authorization tab Type=OAuth 2.0 and I paste the API token in the Access Token field, then I always get the result ‘1’ for any command. But the commands don’t seem to have any effect because I tried to create some users and then get a list of users - which also returns ‘1’.
Can you try this curl command and report back what you get as a response, being sure you place yourApiToken with the token you generated for your super admin:
Same if I run various queries from your Postman Collection and I just replace the URL and API token.
So maybe I don’t generate the API tokens correctly… I do it on the okta.com website, I press Create Token, then I save the generated string and use it in my requests.
I created a new Okta account and used an URL in the form ‘https://dev-xxxxxxxx.okta.com’ instead of using the company name in the URL, this way it worked.