OAuth2 Clients

The OAuth2 client API allows you to register a LaunchDarkly OAuth client for use in your own custom integrations. Registering a LaunchDarkly OAuth client allows you to use LaunchDarkly as an identity provider so that account members can log into your application with their LaunchDarkly account.

You can create and manage LaunchDarkly OAuth clients using the LaunchDarkly OAuth client API. This API acknowledges creation of your client with a response containing a one-time, unique _clientSecret. If you lose your client secret, you will have to register a new client. LaunchDarkly does not store client secrets in plain text.

Several of the endpoints in the OAuth2 client API require an OAuth client ID. The OAuth client ID is returned as part of the Create a LaunchDarkly OAuth 2.0 client and Get clients responses. It is the _clientId field, or the _clientId field of each element in the items array.

You must have Admin privileges or an access token created by a member with Admin privileges in order to be able to use this feature.

Please note that redirectUris must be absolute URIs that conform to the https URI scheme. If you wish to register a client with a different URI scheme, please contact LaunchDarkly Support.

Get clients

Get all OAuth 2.0 clients registered by your account.

Responses
200

OAuth 2.0 client collection response

400

Invalid request

401

Invalid access token

403

Forbidden

get/api/v2/oauth/clients
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "items": [
    ]
}

Create a LaunchDarkly OAuth 2.0 client

Create (register) a LaunchDarkly OAuth2 client. OAuth2 clients allow you to build custom integrations using LaunchDarkly as your identity provider.

Request
Request Body schema: application/json
required
name
string

The name of your new LaunchDarkly OAuth 2.0 client.

redirectUri
string

The redirect URI for your new OAuth 2.0 application. This should be an absolute URL conforming with the standard HTTPS protocol.

description
string

Description of your OAuth 2.0 client.

Responses
201

OAuth 2.0 client response

400

Invalid request

401

Invalid access token

403

Forbidden

post/api/v2/oauth/clients
Request samples
application/json
{
  • "name": "string",
  • "redirectUri": "string",
  • "description": "string"
}
Response samples
application/json
{
  • "_links": {
    },
  • "name": "string",
  • "description": "string",
  • "_accountId": "string",
  • "_clientId": "string",
  • "_clientSecret": "string",
  • "redirectUri": "string",
  • "_creationDate": 0
}

Get client by ID

Get a registered OAuth 2.0 client by unique client ID.

Request
path Parameters
clientId
required
string <string>

The client ID

Responses
200

OAuth 2.0 client response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

get/api/v2/oauth/clients/{clientId}
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "name": "string",
  • "description": "string",
  • "_accountId": "string",
  • "_clientId": "string",
  • "_clientSecret": "string",
  • "redirectUri": "string",
  • "_creationDate": 0
}

Patch client by ID

Patch an existing OAuth 2.0 client by client ID. Updating an OAuth2 client uses a JSON patch representation of the desired changes. To learn more, read Updates. Only name, description, and redirectUri may be patched.

Request
path Parameters
clientId
required
string <string>

The client ID

Request Body schema: application/json
required
Array
op
required
string

The type of operation to perform

path
required
string

A JSON Pointer string specifying the part of the document to operate on

value
any

A JSON value used in "add", "replace", and "test" operations

Responses
200

OAuth 2.0 client response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

patch/api/v2/oauth/clients/{clientId}
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "_links": {
    },
  • "name": "string",
  • "description": "string",
  • "_accountId": "string",
  • "_clientId": "string",
  • "_clientSecret": "string",
  • "redirectUri": "string",
  • "_creationDate": 0
}

Delete OAuth 2.0 client

Delete an existing OAuth 2.0 client by unique client ID.

Request
path Parameters
clientId
required
string <string>

The client ID

Responses
204

Action succeeded

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

delete/api/v2/oauth/clients/{clientId}
Request samples
Response samples
application/json
{
  • "code": "invalid_request",
  • "message": "Invalid request body"
}