<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
How to Get the SessionID Needed to Refresh the Okta Session using GET Current Session API
Single Sign-On
Okta Classic Engine
Okta Identity Engine
Overview

Okta provides an API for getting the current session information for a user. This session information can be retrieved using Postman, a popular API testing and development tool. This article will provide step-by-step instructions on how to use Postman to retrieve the current session information for a user in Okta.
 

Applies To
  • Okta administrators and developers who need to retrieve the current session information for a user in their Okta org.
Solution

Prerequisites

Before beginning, please review Postman integrated with Okta.

 

The video below shows how to use Postman to get a user's Session ID in Okta.

 

 

Obtain the Session ID

  • To retrieve the current session information with the Okta REST API, include the session ID in the request header.
  • To obtain the session ID, follow the steps below.
     

 

Step 1: Obtain the Current Okta Session ID

For Okta Classic

  1. Log in to the Okta organization.
  2. Open the Chrome Developer Tools or any other browser tool that can view cookies.
  3. Navigate to the Application or Storage tab, depending on the browser tool.
  4. Find the Okta domain URL for the organization and select it.
  5. Look for the sid or okta-session-id cookie. This is the session ID needed for the next step.

okta-session-id cookie

 

For Okta Identity Engine (OIE)

  1. Log in to the Okta organization.
  2. Open the Developer Tools.
  3. Switch to the Application tab.
  4. Under Cookies, click on the tenant's URL.
  5. Click idx and copy its value.  

idx value

 

Step 2: Add the Session ID/ idx value to Postman

  1. Open Postman and use the Session API Collection to find the Get Current Session request.
  2. In the request headers, add the following:
    • Cookie in the Key column and "sid=<session ID obtained in Step 1>"/ "idx=<idx value obtained in Step 1>" in the Value column.
      request header 
  3. Click Send to send the request.
  4. If successful, a response will be received with the current session information.

Request sent successful

 

Related References

Loading
How to Get the SessionID Needed to Refresh the Okta Session using GET Current Session API