Okta.Sdk.Api.UserOAuthApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| GetRefreshTokenForUserAndClient | GET /api/v1/users/{userId}/clients/{clientId}/tokens/{tokenId} | Retrieve a refresh token for a client |
| ListRefreshTokensForUserAndClient | GET /api/v1/users/{userId}/clients/{clientId}/tokens | List all refresh tokens for a client |
| RevokeTokenForUserAndClient | DELETE /api/v1/users/{userId}/clients/{clientId}/tokens/{tokenId} | Revoke a token for a client |
| RevokeTokensForUserAndClient | DELETE /api/v1/users/{userId}/clients/{clientId}/tokens | Revoke all refresh tokens for a client |
GetRefreshTokenForUserAndClient
OAuth2RefreshToken GetRefreshTokenForUserAndClient (string userId, string clientId, string tokenId, string expand = null)
Retrieve a refresh token for a client
Retrieves a refresh token issued for the specified user and client
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetRefreshTokenForUserAndClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserOAuthApi(config);
var userId = 00ub0oNGTSWTBKOLGLNR; // string | ID of an existing Okta user
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | Client app ID
var tokenId = sHHSth53yJAyNSTQKDJZ; // string | `id` of Token
var expand = scope; // string | Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)
try
{
// Retrieve a refresh token for a client
OAuth2RefreshToken result = apiInstance.GetRefreshTokenForUserAndClient(userId, clientId, tokenId, expand);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserOAuthApi.GetRefreshTokenForUserAndClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | string | ID of an existing Okta user | |
| clientId | string | Client app ID | |
| tokenId | string | `id` of Token | |
| expand | string | Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListRefreshTokensForUserAndClient
List<OAuth2RefreshToken> ListRefreshTokensForUserAndClient (string userId, string clientId, string expand = null, string after = null, int? limit = null)
List all refresh tokens for a client
Lists all refresh tokens issued for the specified user and client
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListRefreshTokensForUserAndClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserOAuthApi(config);
var userId = 00ub0oNGTSWTBKOLGLNR; // string | ID of an existing Okta user
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | Client app ID
var expand = scope; // string | Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. (optional)
var after = "after_example"; // string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
var limit = 20; // int? | Specifies the number of tokens to return (optional) (default to 20)
try
{
// List all refresh tokens for a client
List<OAuth2RefreshToken> result = apiInstance.ListRefreshTokensForUserAndClient(userId, clientId, expand, after, limit).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserOAuthApi.ListRefreshTokensForUserAndClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | string | ID of an existing Okta user | |
| clientId | string | Client app ID | |
| expand | string | Valid value: `scope`. If specified, scope details are included in the `_embedded` attribute. | [optional] |
| after | string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See Pagination. | [optional] |
| limit | int? | Specifies the number of tokens to return | [optional] [default to 20] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RevokeTokenForUserAndClient
void RevokeTokenForUserAndClient (string userId, string clientId, string tokenId)
Revoke a token for a client
Revokes the specified refresh and access tokens
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class RevokeTokenForUserAndClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserOAuthApi(config);
var userId = 00ub0oNGTSWTBKOLGLNR; // string | ID of an existing Okta user
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | Client app ID
var tokenId = sHHSth53yJAyNSTQKDJZ; // string | `id` of Token
try
{
// Revoke a token for a client
apiInstance.RevokeTokenForUserAndClient(userId, clientId, tokenId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserOAuthApi.RevokeTokenForUserAndClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | string | ID of an existing Okta user | |
| clientId | string | Client app ID | |
| tokenId | string | `id` of Token |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RevokeTokensForUserAndClient
void RevokeTokensForUserAndClient (string userId, string clientId)
Revoke all refresh tokens for a client
Revokes all refresh tokens issued for the specified user and client
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class RevokeTokensForUserAndClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserOAuthApi(config);
var userId = 00ub0oNGTSWTBKOLGLNR; // string | ID of an existing Okta user
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | Client app ID
try
{
// Revoke all refresh tokens for a client
apiInstance.RevokeTokensForUserAndClient(userId, clientId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserOAuthApi.RevokeTokensForUserAndClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | string | ID of an existing Okta user | |
| clientId | string | Client app ID |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]