Skip to main content

Get OAuth Client by ID

Retrieves detailed information about a specific OAuth client by its unique identifier. This endpoint returns the full configuration for an OAuth client including scopes, redirect URIs, token settings, and usage statistics. Used for OAuth client management and troubleshooting.


Endpoint

Method: GET URL: {{base_url}}/api/v1/oauth-clients/{clientId}


Authentication

This endpoint uses Bearer Token authentication via a JWT (JSON Web Token). The token must be included in the Authorization header. Requires admin-level permissions.


Headers

HeaderDescriptionRequired
AuthorizationBearer token (JWT) for authenticationYes
acceptSpecifies acceptable response formats (application/json)Yes
x-tenantidUUID identifying the tenant/organizationYes
realmnameThe authentication realm nameNo

Path Parameters

ParameterTypeDescriptionRequired
clientIdstring (UUID)The unique identifier of the OAuth clientYes

Query Parameters

None.


Request Body Schema

Not applicable — this is a GET request with no request body.


Example cURL

curl --request GET \
--url '{{base_url}}/api/v1/oauth-clients/{{oauth_client_id}}' \
--header 'accept: application/json' \
--header 'authorization: Bearer {{access_token}}' \
--header 'x-tenantid: {{tenant_id}}'

Success Response Example

Status Code: 200 OK

{
"success": true,
"message": "OAuth client retrieved successfully",
"data": {
"id": "{{oauth_client_id}}",
"name": "ServiceNow Integration",
"description": "OAuth client for ServiceNow ITSM integration",
"clientId": "{{client_id}}",
"clientType": "confidential",
"redirectUris": [
"{{redirect_uri_1}}",
"{{redirect_uri_2}}"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"scopes": [
"ticketing:read",
"ticketing:write",
"users:read"
],
"allowedOrigins": [
"{{allowed_origin}}"
],
"ipWhitelist": [],
"status": "active",
"tokenSettings": {
"accessTokenLifetime": 3600,
"refreshTokenLifetime": 86400,
"idTokenLifetime": 3600,
"tokenFormat": "jwt",
"refreshTokenRotation": true,
"reuseInterval": 0
},
"pkceSettings": {
"required": false,
"allowPlainChallenge": false,
"supportedMethods": ["S256"]
},
"consent": {
"requireConsent": true,
"skipConsentForFirstParty": true,
"consentLifetime": 2592000
},
"security": {
"requireClientAuthentication": true,
"allowedAuthMethods": ["client_secret_post", "client_secret_basic"],
"enforceHttps": true,
"validateRedirectUri": true
},
"usage": {
"totalTokenRequests": 154200,
"successfulTokenRequests": 153890,
"failedTokenRequests": 310,
"activeTokenCount": 245,
"lastUsedAt": "2025-07-10T12:00:00.000Z",
"lastUsedFromIp": "{{last_used_ip}}",
"firstUsedAt": "2024-06-16T08:30:00.000Z",
"averageRequestsPerDay": 428
},
"audit": {
"createdAt": "2024-06-15T10:00:00.000Z",
"createdBy": {
"id": "{{created_by_user_id}}",
"name": "{{created_by_user_name}}",
"email": "{{created_by_user_email}}"
},
"updatedAt": "2025-05-20T14:00:00.000Z",
"updatedBy": {
"id": "{{updated_by_user_id}}",
"name": "{{updated_by_user_name}}",
"email": "{{updated_by_user_email}}"
},
"lastSecretRotatedAt": "2025-01-15T09:00:00.000Z",
"secretRotationCount": 2
},
"tenant": {
"id": "{{tenant_id}}",
"name": "{{tenant_name}}"
}
},
"timestamp": "2025-07-10T13:25:00.000Z"
}

OAuth Client Object Schema

FieldTypeDescription
idstringUnique internal identifier (UUID)
namestringHuman-readable name
descriptionstringDescription of the client's purpose
clientIdstringOAuth client ID for authentication
clientTypestringClient type: confidential or public
redirectUrisarrayRegistered redirect URIs
grantTypesarrayAllowed OAuth grant types
scopesarrayPermitted scopes
allowedOriginsarrayCORS allowed origins
ipWhitelistarrayIP restrictions
statusstringClient status: active, inactive, revoked
tokenSettingsobjectToken configuration
pkceSettingsobjectPKCE configuration
consentobjectConsent screen settings
securityobjectSecurity configuration
usageobjectUsage statistics
auditobjectAudit trail information
tenantobjectAssociated tenant

Token Settings Object

FieldTypeDescription
accessTokenLifetimeintegerAccess token lifetime in seconds
refreshTokenLifetimeintegerRefresh token lifetime in seconds
idTokenLifetimeintegerID token lifetime in seconds
tokenFormatstringToken format: jwt or opaque
refreshTokenRotationbooleanWhether refresh tokens are rotated on use
reuseIntervalintegerSeconds a rotated refresh token remains valid

PKCE Settings Object

FieldTypeDescription
requiredbooleanWhether PKCE is required for auth code flow
allowPlainChallengebooleanAllow plain code challenge (not recommended)
supportedMethodsarraySupported challenge methods: S256, plain

Usage Statistics Object

FieldTypeDescription
totalTokenRequestsintegerTotal token requests made
successfulTokenRequestsintegerSuccessful token requests
failedTokenRequestsintegerFailed token requests
activeTokenCountintegerCurrently active (non-expired) tokens
lastUsedAtstring|nullISO 8601 timestamp of last usage
lastUsedFromIpstring|nullIP address of last request
firstUsedAtstring|nullISO 8601 timestamp of first usage
averageRequestsPerDaynumberAverage daily token requests

Error Responses

Status CodeErrorDescription
400 Bad RequestInvalid client ID formatThe clientId is not a valid UUID
401 UnauthorizedAuthentication failedBearer token is missing, expired, or invalid
403 ForbiddenInsufficient permissionsUser lacks permission to view this OAuth client
404 Not FoundOAuth client not foundNo OAuth client exists with the specified ID
500 Internal Server ErrorServer errorUnexpected server-side error

Example Error Response:

{
"success": false,
"error": {
"code": "OAUTH_CLIENT_NOT_FOUND",
"message": "OAuth client not found",
"details": "No OAuth client exists with ID: {{oauth_client_id}}"
},
"timestamp": "2025-07-10T13:25:00.000Z"
}

Notes

  1. Security: The clientSecret is never returned. Only the clientId is shown for identification.

  2. UUID Format: The clientId path parameter must be a valid UUID. Invalid formats will return a 400 error.

  3. Detailed Configuration: Unlike the list endpoint, this response includes full configuration details:

    • Token settings (lifetimes, rotation policy)
    • PKCE settings
    • Consent configuration
    • Security settings
  4. Usage Analytics: The usage object provides comprehensive statistics for auditing and monitoring client activity.

  5. Audit Trail: The audit object tracks creation, updates, and secret rotation history for compliance.

  6. Token Settings: Review tokenSettings to understand token lifetimes:

    • accessTokenLifetime: Typically 1 hour (3600 seconds)
    • refreshTokenLifetime: Typically 24 hours (86400 seconds)
    • idTokenLifetime: Typically 1 hour (3600 seconds)
  7. PKCE Enforcement: Check pkceSettings.required to know if PKCE is mandatory for authorization code flows.

  8. Required Roles: Typically requires tenant_admin or oauth_admin role to view OAuth client details.

  9. Related Endpoints:

    • GET /oauth-clients — List all OAuth clients
    • POST /oauth-clients — Create new OAuth client
    • PUT /oauth-clients/{clientId} — Update OAuth client
    • DELETE /oauth-clients/{clientId} — Delete OAuth client
    • POST /oauth-clients/{clientId}/rotate-secret — Rotate client secret