---
title: "Get OAuth2 Client by id (getOAuth2ClientById)"
method: GET
path: "/api/oauth2/client/{id}"
tags: ["o-auth-2-controller"]
---

# Get OAuth2 Client by id (getOAuth2ClientById)

`GET /api/oauth2/client/{id}`

Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.

## Path parameters

- `id` string, uuid, required

## Response `200`

OK

- OAuth2Client
  - `id` OAuth2ClientId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT' | 'CUSTOMER' | 'USER' | 'DASHBOARD' | 'ASSET' | 'DEVICE' | 'ALARM' | 'RULE_CHAIN' | 'RULE_NODE' | 'ENTITY_VIEW' | 'WIDGETS_BUNDLE' | 'WIDGET_TYPE' | 'TENANT_PROFILE' | 'DEVICE_PROFILE' | 'ASSET_PROFILE' | 'API_USAGE_STATE' | 'TB_RESOURCE' | 'OTA_PACKAGE' | 'EDGE' | 'RPC' | 'QUEUE' | 'NOTIFICATION_TARGET' | 'NOTIFICATION_TEMPLATE' | 'NOTIFICATION_REQUEST' | 'NOTIFICATION' | 'NOTIFICATION_RULE' | 'QUEUE_STATS' | 'OAUTH2_CLIENT' | 'DOMAIN' | 'MOBILE_APP' | 'MOBILE_APP_BUNDLE' | 'CALCULATED_FIELD' | 'JOB' | 'ADMIN_SETTINGS' | 'AI_MODEL' | 'API_KEY', required
  - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
  - `additionalInfo` unknown, required
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `title` string, required — Oauth2 client title
  - `mapperConfig` OAuth2MapperConfig, required
    - `allowUserCreation` boolean — Whether user should be created if not yet present on the platform after successful authentication
    - `activateUser` boolean — Whether user credentials should be activated when user is created after successful authentication
    - `type` 'BASIC' | 'CUSTOM' | 'GITHUB' | 'APPLE', required — Type of OAuth2 mapper. Depending on this param, different mapper config fields must be specified
    - `basic` OAuth2BasicMapperConfig
      - `emailAttributeKey` string — Email attribute key of OAuth2 principal attributes. Must be specified for BASIC mapper type and cannot be specified for GITHUB type
      - `firstNameAttributeKey` string — First name attribute key
      - `lastNameAttributeKey` string — Last name attribute key
      - `tenantNameStrategy` 'DOMAIN' | 'EMAIL' | 'CUSTOM', required — Tenant naming strategy. For DOMAIN type, domain for tenant name will be taken from the email (substring before '@')
      - `tenantNamePattern` string — Tenant name pattern for CUSTOM naming strategy. OAuth2 attributes in the pattern can be used by enclosing attribute key in '%{' and '}'
      - `customerNamePattern` string — Customer name pattern. When creating a user on the first OAuth2 log in, if specified, customer name will be used to create or find existing customer in the platform and assign customerId to the user
      - `defaultDashboardName` string — Name of the tenant's dashboard to set as default dashboard for newly created user
      - `alwaysFullScreen` boolean — Whether default dashboard should be open in full screen
    - `custom` OAuth2CustomMapperConfig
      - `url` string
      - `username` string
      - `password` string
      - `sendToken` boolean
  - `clientId` string, required — OAuth2 client ID. Cannot be empty
  - `clientSecret` string, required — OAuth2 client secret. Cannot be empty
  - `authorizationUri` string, required — Authorization URI of the OAuth2 provider. Cannot be empty
  - `accessTokenUri` string, required — Access token URI of the OAuth2 provider. Cannot be empty
  - `scope` string[], required — OAuth scopes that will be requested from OAuth2 platform. Cannot be empty
  - `userInfoUri` string — User info URI of the OAuth2 provider
  - `userNameAttributeName` string, required — Name of the username attribute in OAuth2 provider response. Cannot be empty
  - `jwkSetUri` string — JSON Web Key URI of the OAuth2 provider
  - `clientAuthenticationMethod` string, required — Client authentication method to use: 'BASIC' or 'POST'. Cannot be empty
  - `loginButtonLabel` string, required — OAuth2 provider label. Cannot be empty
  - `loginButtonIcon` string — Log in button icon for OAuth2 provider
  - `platforms` string[] — List of platforms for which usage of the OAuth2 client is allowed (empty for all allowed)
  - `name` string

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
