Create an API token | Okta Developer (2024)

This guide explains what an API token is, why you need one, and how to create one.

Learning outcomes

  • Learn how an Okta API token is used.
  • Understand why it's good practice to create a service account for use with an API token.
  • Know the alternatives to Okta API tokens.
  • Find out when a token expires and what happens when it expires.
  • Find out how API tokens are deactivated.

What you need

Okta Developer Edition organization (opens new window)

Okta API tokens

Okta API tokens are used to authenticate requests to Okta APIs. When calling an Okta API endpoint, you need to supply a valid API token in the HTTP Authorization header, with a valid token specified as the header value. You need to prefix the value with the SSWS identifier, which specifies the proprietary authentication scheme that Okta uses. For example:

Privilege level

Different Okta API operations require different admin privilege levels. API tokens inherit the privilege level of the admin account that is used to create them. It’s therefore good practice to create a service account to use when you create API tokens. With a separate service account, you can assign specific privilege levels to your API tokens. See Administrators (opens new window) for admin account types and the specific privileges of each.

OAuth 2.0 instead of API tokens

As an alternative to Okta API tokens, you can use Okta APIs. You can use a scoped OAuth 2.0 access token for various Okta endpoints. Each access token enables the bearer to perform specific actions on specific Okta endpoints, with that ability controlled by which scopes the access token contains. For more information, see the OAuth for Okta guide.

Create the token

See Create Okta API tokens (opens new window) to create an API token and define the network zones that API calls can originate from.

Note: Record the token value. This is the only opportunity to see it and record it.

Token network restrictions

You can specify a network range for every SSWS API token. The tokens only work if API requests are made from the specified IP or network range. You can specify network zones while you create an API token. You can also modify an existing token to specify a network range.

See Manage Okta API tokens (opens new window) for steps on creating API tokens and editing network restrictions for an existing API token.

Token rate limits

When API tokens are created, the rate limit for each token interaction is set automatically to 50 percent of each API maximum limit. See API rate limits. You can adjust this percentage by editing the Token rate limits section. See Set token rate limits (opens new window).

Token expiration and deactivation

Tokens expire automatically after a certain period and can also be deactivated at any time.

Token expiration

Tokens are valid for 30 days from creation or last use, so that the 30 day expiration automatically refreshes with each API call. Tokens that aren't used for 30 days expire. The 30-day period is fixed and can't be changed for your org.

Token deactivation

If a user account is deactivated in Okta, any API token created by that user account is deprovisioned at the same time.

Next steps

With the token created, you can begin using it, supplying it in the Authorization header of calls to Okta API endpoints. See Sign users into your SPA using the redirect model for a functional example.

See also

Create an API token | Okta Developer (2024)

FAQs

Create an API token | Okta Developer? ›

Super admins, org admins, group admins, group membership admins, and read-only admins may create tokens. Tokens are valid only if the user who created them is active. Tokens issued by deactivated users are rejected.

How to generate an API token? ›

To generate an API token, perform the following:
  1. From Home > My Access, select the appropriate resource for which you need to generate a token. ...
  2. Click API Token > Generate Token.
  3. Specify the following details: ...
  4. Click Generate Token. ...
  5. Click to copy the appropriate token and use it as required.

Who can create an API token in Okta? ›

Super admins, org admins, group admins, group membership admins, and read-only admins may create tokens. Tokens are valid only if the user who created them is active. Tokens issued by deactivated users are rejected.

What is an API token? ›

In contrast, an API token is a string of codes containing comprehensive data that identifies a specific user. API tokens also carry the scope of access granted to a specific user. This allows the server to both authenticate requests of the calling user and validate the extent of API usage.

How do I create an authentication token in Web API? ›

See Authentication Service for more information on authentication processes.
  1. What is JWT? From the JWT website: ...
  2. JWT library. ...
  3. Preparing to use tokens. ...
  4. Create private and public keys. ...
  5. Replace newline characters. ...
  6. Create your public key JSON file. ...
  7. Register your public key. ...
  8. Create a JWT signature.
Mar 11, 2024

How are API tokens typically generated? ›

An API token follows a set series of steps. First, the API verifies the username and password from the payload. Once these are verified, the API sends an asset to your browser to be stored. Then anytime you send a query to the API, the access token is sent along with it.

How do I create an API authentication? ›

Authentication is typically done by requiring the client to provide some form of credentials – such as a user name and password, an OAuth token, or a JSON Web Token (JWT). As an API owner, you can implement authentication in Apigee using policies.

What is the difference between API Key and API token? ›

The main distinction between these two is: API keys identify the calling project — the application or site — making the call to an API. Authentication tokens identify a user — the person — that is using the app or site.

Who generates API Key? ›

API keys are generated by the project making a call but cannot be used to identify who created the project.

How do I create a bearer token for API? ›

How to Generate Bearer Token
  1. What are Bearer Tokens?
  2. How to Generate a Bearer Token on GitHub?
  3. Step 1: Register your application on GitHub.
  4. Step 2: Request authorization from the user.
  5. Step 3: Exchange authorization code for a token.
  6. Step 4: Use the Bearer token.
  7. Pass and Run Bearer Token in Apidog.

How do I get my API access token? ›

Navigate to the API access page in the admin UI (available at the URL /admin/api ). Use the navigation menu item "Configure" and select "API access". On the API access page, use the "New API token" button to navigate to the token creation form.

How to generate an API key? ›

To create your application's API key:
  1. Go to the API Console.
  2. From the projects list, select a project or create a new one.
  3. If the APIs & services page isn't already open, open the left side menu and select APIs & services.
  4. On the left, choose Credentials.
  5. Click Create credentials and then select API key.

Is API token a secret? ›

Secret API keys serve as secure tokens to authenticate and authorize requests made to your API. They are deemed secret because their exposure to unauthorized individuals or the public could lead to security breaches.

How do I create an auth token? ›

Add the relevant information in the following fields and click Create Service:
  1. In the Service Name field, type a name for this authorized service. ...
  2. From the User Role list, select Admin the user role.
  3. From the Security Profile list, select the security profile that you want to assign to this authorized service.

How do I pass an API authentication token? ›

The second way to pass your API token is via a query parameter called key in the URL like below. Use of the X-Dataverse-key HTTP header form is preferred to passing key in the URL because query parameters like key appear in URLs and might accidentally get shared, exposing your API token. (Again it's like a password.)

How do I add an access token to my API URL? ›

Set the request URL to: https://{your-openremote-url}/api/master/asset/{assetID} (see also OpenRemote Manager HTTP API Swagger UI) Add an Authorization header to the request and set the value to Bearer {access_token} , where {access_token} is the access token obtained in the previous step.

How do I generate my API key? ›

Setting up API keys
  1. Go to the API Console.
  2. From the projects list, select a project or create a new one.
  3. If the APIs & services page isn't already open, open the left side menu and select APIs & services.
  4. On the left, choose Credentials.
  5. Click Create credentials and then select API key.

How do I create an API bearer token? ›

Generate Bearer Token Using API Credentials
  1. Step #1 Download Postman Collection. If you do not have the postman tool installed, refer to download instructions and install Postman.
  2. Step #2 Get API product credentials for token generation. ...
  3. Step #3 Generate Bearer Token.

How do I create a Google API token? ›

To create an API key:
  1. In the Google Cloud console, go to Menu menu > APIs & Services > Credentials. Go to Credentials.
  2. Click Create credentials > API key.
  3. Your new API key is displayed. Click Copy content_copy to copy your API key for use in your app's code.

How to generate API token for Postman? ›

To generate a Postman API key, do the following:
  1. Select your avatar in the Postman header, then select Settings. In the account settings page, select API keys.
  2. If you don't have a key, you'll be prompted to create one. Select Generate API Key.
  3. Enter a name for your key and select Generate API Key.
  4. Copy your key.
May 20, 2024

Top Articles
...
How do I pay through a payment request from a merchant?
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 6265

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.