Inbound Apps with SDKs

Use the Descope Management SDK to create, update, patch, delete, and load Inbound Apps (third-party applications in the Management API), as well as manage secrets and consents. The Management SDK requires a management key.

For an overview of inbound app concepts and console setup, see Creating Inbound Apps.

Note

The preferred method of defining scopes for your backend services is to use a Resource and define a policy for access to it.

You can still define permissionsScopes and attributesScopes on the inbound app itself if you prefer.

Backend SDK

Install SDK

Terminal
npm i --save @descope/node-sdk
Terminal
pip3 install descope
Terminal
go get github.com/descope/go-sdk
// Include the following in your `pom.xml` (Maven)
<dependency>
    <artifactId>java-sdk</artifactId>
    <groupId>com.descope</groupId>
    <version>sdk-version</version> // Check https://github.com/descope/descope-java/releases for the latest versions
</dependency>
Terminal
gem install descope
Terminal
composer require descope/descope-php
Terminal
dotnet add package Descope

Import and initialize SDK

import DescopeClient from '@descope/node-sdk';
try{
    //  baseUrl="<URL>" // When initializing the Descope client, you can also configure the baseUrl ex: https://auth.company.com  - this is useful when you utilize a custom domain within your Descope project.
    const descopeClient = DescopeClient({ projectId: '__ProjectID__' });
} catch (error) {
    // handle the error
    console.log("failed to initialize: " + error)
}
from descope import (
    REFRESH_SESSION_TOKEN_NAME,
    SESSION_TOKEN_NAME,
    AuthException,
    DeliveryMethod,
    DescopeClient,
    AssociatedTenant,
    RoleMapping,
    AttributeMapping,
    LoginOptions
)
try:
    # You can configure the baseURL by setting the env variable Ex: export DESCOPE_BASE_URI="https://auth.company.com  - this is useful when you utilize custom domain within your Descope project."
    descope_client = DescopeClient(project_id='__ProjectID__')
except Exception as error:
    # handle the error
    print ("failed to initialize. Error:")
    print (error)
import "github.com/descope/go-sdk/descope"
import "github.com/descope/go-sdk/descope/client"

// Utilizing the context package allows for the transmission of context capabilities like cancellation
//      signals during the function call. In cases where context is absent, the context.Background()
//      function serves as a viable alternative.
//      Utilizing context within the Descope GO SDK is supported within versions 1.6.0 and higher.
import (
	"context"
)

// DescopeBaseURL // within the client.Config, you can also configure the baseUrl ex: https://auth.company.com  - this is useful when you utilize a custom domain within your Descope project.

descopeClient, err := client.NewWithConfig(&client.Config{ProjectID:"__ProjectID__"})
if err != nil {
    // handle the error
    log.Println("failed to initialize: " + err.Error())
}
import com.descope.client.Config;
import com.descope.client.DescopeClient;

var descopeClient = new DescopeClient(Config.builder().projectId("__ProjectID__").build());
require 'descope'

@project_id = ENV['__ProjectID__']
@client = Descope::Client.new({ project_id: @project_id})
require 'vendor/autoload.php';
use Descope\SDK\DescopeSDK;
 
$descopeSDK = new DescopeSDK([
    'projectId' => $_ENV['__ProjectID__'],
]);
using Descope;

// Configure the Descope client
var options = new DescopeClientOptions
{
    ProjectId = "__ProjectID__",                // Required
    ManagementKey = "DESCOPE_MANAGEMENT_KEY",   // Optional, for management APIs
    BaseUrl = "__BaseURL__",        // Optional, auto-detected from project ID, only set to override 
    JwksCacheDuration = TimeSpan.FromMinutes(5) // Optional, how long public signing keys are cached (default: 5 minutes)
};

// Option 1: Dependency Injection - best for ASP.NET Core apps; registers IDescopeClient so it can be injected into your services
builder.Services.AddDescopeClient(options);

// Then inject IDescopeClient wherever you need it
public class MyService
{
    private readonly IDescopeClient descopeClient;
    
    public MyService(IDescopeClient client)
    {
        descopeClient = client;
    }
}

// Option 2: Factory (Create once and reuse this instance) - best for console apps, background workers, or when you need to manually control the client's lifetime
var descopeClient = DescopeManagementClientFactory.Create(options);

Application Management

Create, update, load, and delete inbound apps, and manage client secrets.

Create Inbound Application

This operation creates a new inbound application with the provided details. Using the SDK or Management API is one way to register a non-confidential inbound app without Dynamic Client Registration (DCR).

Note

Create/update field support varies by SDK. Python, Go, and Ruby accept additional options such as forcePkce / force_pkce, defaultAudience / default_audience, customAttributes / custom_attributes, and JWT Bearer settings. The Node.js typed options currently cover the core fields below; use the Management API for the full request schema.

// Args:
//   name (String): Name (required)
//   description (String): Optional description
//   logo (String): Optional logo URL
//   loginPageUrl (String): Optional login page URL
//   approvedCallbackUrls (String[]): Optional list of approved callback URLs
//   permissionsScopes (InboundAppScope[]): Array of permission scopes, can be empty (required)
//   attributesScopes (InboundAppScope[]): Optional array of attribute scopes

const {
  data: { id, cleartext: secret },
} = await descopeClient.management.inboundApplication.createApplication({
  name: 'my new app',
  description: 'my desc',
  logo: 'data:image/png;..',
  approvedCallbackUrls: ['example.com'],
  permissionsScopes: [
    {
      name: 'read_support',
      description: 'read for support',
      values: ['Support'],
    },
  ],
  attributesScopes: [
    {
      name: 'read_email',
      description: 'read user email',
      values: ['email'],
    },
  ],
  loginPageUrl: 'http://example.com/login',
});
# Args:
#   name (str): Name (required)
#   login_page_url (str): Login page URL (required in the Python SDK)
#   description (str): Optional description
#   logo (str): Optional logo URL
#   approved_callback_urls (List[str]): Optional list of approved callback URLs
#   permissions_scopes (List[dict]): Optional permission scopes (name, description, values)
#   attributes_scopes (List[dict]): Optional attribute scopes (name, description, values)
#   jwt_bearer_settings (dict): Optional JWT Bearer validation settings
#   custom_attributes (dict): Optional custom attributes on the app
#   force_pkce (bool): Optional; require PKCE on the authorization-code flow
#   default_audience (str): Optional default aud: "projectId", "clientId", or "" (both)

try:
    resp = descope_client.mgmt.third_party_application.create(
        name='my new app',
        description='my desc',
        logo='data:image/png;..',
        approved_callback_urls=['example.com'],
        permissions_scopes=[
            {
                'name': 'read_support',
                'description': 'read for support',
                'values': ['Support'],
            },
        ],
        attributes_scopes=[
            {
                'name': 'read_email',
                'description': 'read user email',
                'values': ['email'],
            },
        ],
        login_page_url='http://example.com/login',
    )
    app_id = resp['id']
    secret = resp['cleartext']
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context — use context.Background() if none
//    req (*descope.ThirdPartyApplicationRequest):
//      Name, LoginPageURL (typical required fields)
//      Description, Logo, ApprovedCallbackUrls
//      PermissionsScopes, ScopeClaimMapping (optional)
//      JWTBearerSettings, CustomAttributes (optional)
//      ForcePkce (bool), DefaultAudience ("projectId" | "clientId" | "")

ctx := context.Background()

req := &descope.ThirdPartyApplicationRequest{
    Name:                 "my new app",
    Description:          "my desc",
    Logo:                 "data:image/png;..",
    LoginPageURL:         "http://example.com/login",
    ApprovedCallbackUrls: []string{"example.com"},
    PermissionsScopes: []*descope.ThirdPartyApplicationScope{
        {
            Name:        "read_support",
            Description: "read for support",
            Values:      []string{"Support"},
        },
    },
    // ForcePkce: true,
    // DefaultAudience: "clientId",
}

appID, secret, err := descopeClient.Management.ThirdPartyApplication().CreateApplication(ctx, req)
if err != nil {
    // Handle the error
}
// Args:
//   name (String): Name of the inbound app (required)
//   id (String): Optional custom app ID
//   description (String): Optional description
//   logo (String): Optional logo URL
//   loginPageUrl (String): Optional login page URL
//   approvedCallbackUrls (String[]): Optional list of approved callback URLs
//   permissionsScopes (InboundAppScope[]): Optional array of permission scopes
//   attributesScopes (InboundAppScope[]): Optional array of attribute scopes
// Additional API fields (session settings, CIBA, audience, etc.) may be available via the Management API
try {
    InboundAppCreateResponse response = inboundAppsService.createApplication(
        InboundAppRequest.builder()
            .name("My Inbound App")
            // .id("optional-custom-id")
            // .description("optional-description")
            // .logo("optional-logo")
            // .loginPageUrl("optional-loginPageUrl")
            // .approvedCallbackUrls(new String[] { "https://example.com/callback1" })
            // .permissionsScopes(new InboundAppScope[] {
            //     InboundAppScope.builder()
            //         .name("scope-name")
            //         .description("optional description")
            //         .build()
            // })
            // .attributesScopes(new InboundAppScope[] {
            //     InboundAppScope.builder()
            //         .name("attribute-scope-name")
            //         .description("optional description")
            //         .build()
            // })
            .build()
    );
    String appId = response.getId();
    String secret = response.getSecret();
} catch (DescopeException de) {
    // Handle the error
}
# Args:
#   name: Name (required)
#   id: Optional custom app ID
#   description: Optional description
#   logo: Optional logo URL
#   login_page_url: Optional login page URL
#   approved_callback_urls: Optional list of approved callback URLs
#   permissions_scopes: Optional array of permission scopes
#   attributes_scopes: Optional array of attribute scopes
#   jwt_bearer_settings: Optional JWT Bearer validation settings
#   custom_attributes: Optional custom attributes on the app
#   force_pkce: Optional; require PKCE on the authorization-code flow
#   default_audience: Optional default aud ("projectId", "clientId", or similar)

resp = descope_client.create_application(
  name: 'my new app',
  description: 'my desc',
  logo: 'data:image/png;..',
  approved_callback_urls: ['example.com'],
  permissions_scopes: [
    {
      name: 'read_support',
      description: 'read for support',
      values: ['Support'],
    },
  ],
  attributes_scopes: [
    {
      name: 'read_email',
      description: 'read user email',
      values: ['email'],
    },
  ],
  login_page_url: 'http://example.com/login',
)
id = resp['id']
secret = resp['cleartext']
// Args:
//   createRequest (CreateThirdPartyApplicationRequest): Application configuration

var createRequest = new CreateThirdPartyApplicationRequest
{
    Name = "my new app",
    Description = "my desc",
    Logo = "data:image/png;..",
    LoginPageUrl = "http://example.com/login",
    ApprovedCallbackUrls = new List<string> { "example.com" },
    PermissionsScopes = new List<ThirdPartyApplicationScope>
    {
        new() { Name = "read_support", Description = "read for support", Values = new List<string> { "Support" } },
    },
    AttributesScopes = new List<ThirdPartyApplicationScope>
    {
        new() { Name = "read_email", Description = "read user email", Values = new List<string> { "email" } },
    },
};

try
{
    var createResponse = await descopeClient.Mgmt.V1.Thirdparty.App.Create.PostAsync(createRequest);
    var appId = createResponse.Id;
    var secret = createResponse.Cleartext;
}
catch (DescopeException ex)
{
    // Handle the error
}

Update Inbound Application

This operation updates an existing inbound application, overwriting all fields with the provided values.

Note

All provided parameters are used as overrides to the existing application. Empty fields will override populated fields.

// Args:
//   id (String): App ID (required)
//   name (String): Name (required)
//   description (String): Optional description
//   logo (String): Optional logo URL
//   loginPageUrl (String): Optional login page URL
//   approvedCallbackUrls (String[]): Optional list of approved callback URLs
//   permissionsScopes (InboundAppScope[]): Array of permission scopes, can be empty (required)
//   attributesScopes (InboundAppScope[]): Optional array of attribute scopes

await descopeClient.management.inboundApplication.updateApplication({
  id: 'app-id',
  name: 'my updated app',
  description: 'my desc',
  logo: 'data:image/png;..',
  approvedCallbackUrls: ['example.com'],
  permissionsScopes: [
    {
      name: 'read_support',
      description: 'read for support',
      values: ['Support'],
    },
  ],
  attributesScopes: [
    {
      name: 'read_email',
      description: 'read user email',
      values: ['email'],
    },
  ],
  loginPageUrl: 'http://example.com/login',
});
# Args:
#   id (str): App ID (required)
#   name (str): Name (required)
#   login_page_url (str): Login page URL (required in the Python SDK)
#   description (str): Optional description
#   logo (str): Optional logo URL
#   approved_callback_urls (List[str]): Optional list of approved callback URLs
#   permissions_scopes (List[dict]): Optional permission scopes
#   attributes_scopes (List[dict]): Optional attribute scopes
#   jwt_bearer_settings, custom_attributes, force_pkce, default_audience: same as Create

try:
    descope_client.mgmt.third_party_application.update(
        id='app-id',
        name='my updated app',
        description='my desc',
        logo='data:image/png;..',
        approved_callback_urls=['example.com'],
        permissions_scopes=[
            {
                'name': 'read_support',
                'description': 'read for support',
                'values': ['Support'],
            },
        ],
        attributes_scopes=[
            {
                'name': 'read_email',
                'description': 'read user email',
                'values': ['email'],
            },
        ],
        login_page_url='http://example.com/login',
    )
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    req (*descope.ThirdPartyApplicationRequest): Full application configuration (overrides all fields).
//      Same optional fields as Create (JWTBearerSettings, CustomAttributes, ForcePkce, DefaultAudience, ScopeClaimMapping, etc.)

ctx := context.Background()

req := &descope.ThirdPartyApplicationRequest{
    ID:                   "app-id",
    Name:                 "my updated app",
    Description:          "my desc",
    Logo:                 "data:image/png;..",
    LoginPageURL:         "http://example.com/login",
    ApprovedCallbackUrls: []string{"example.com"},
    PermissionsScopes: []*descope.ThirdPartyApplicationScope{
        {Name: "read_support", Description: "read for support", Values: []string{"Support"}},
    },
}

err := descopeClient.Management.ThirdPartyApplication().UpdateApplication(ctx, req)
if err != nil {
    // Handle the error
}
// Args:
//   id (String): App ID (required)
//   name (String): Name (required)
//   description (String): Optional description
//   logo (String): Optional logo URL
//   loginPageUrl (String): Optional login page URL
//   approvedCallbackUrls (String[]): Optional list of approved callback URLs
//   permissionsScopes (InboundAppScope[]): Array of permission scopes, can be empty (required)
//   attributesScopes (InboundAppScope[]): Optional array of attribute scopes
try {
    inboundAppsService.updateApplication(
        InboundAppRequest.builder()
            .id("app-id")
            .name("Updated Name")
            // .description("optional-description")
            // .logo("optional-logo")
            // .loginPageUrl("optional-loginPageUrl")
            // .approvedCallbackUrls(new String[] { "https://example.com/callback1" })
            // .permissionsScopes(new InboundAppScope[] {
            //     InboundAppScope.builder().name("scope-name").build()
            // })
            // .attributesScopes(new InboundAppScope[] {
            //     InboundAppScope.builder().name("attribute-scope-name").build()
            // })
            .build()
    );
} catch (DescopeException de) {
    // Handle the error
}
# Args:
#   id: App ID (required)
#   name: Name (required)
#   description: Optional description
#   logo: Optional logo URL
#   login_page_url: Optional login page URL
#   approved_callback_urls: Optional list of approved callback URLs
#   permissions_scopes: Array of permission scopes, can be empty (required)
#   attributes_scopes: Optional array of attribute scopes
#   jwt_bearer_settings, custom_attributes, force_pkce, default_audience: same as Create

descope_client.update_application(
  id: 'app-id',
  name: 'my updated app',
  description: 'my desc',
  logo: 'data:image/png;..',
  approved_callback_urls: ['example.com'],
  permissions_scopes: [
    { name: 'read_support', description: 'read for support', values: ['Support'] },
  ],
  attributes_scopes: [
    { name: 'read_email', description: 'read user email', values: ['email'] },
  ],
  login_page_url: 'http://example.com/login',
)
// Args:
//   updateRequest (UpdateThirdPartyApplicationRequest): Full application configuration (overrides all fields)

var updateRequest = new UpdateThirdPartyApplicationRequest
{
    Id = "app-id",
    Name = "my updated app",
    Description = "my desc",
    Logo = "data:image/png;..",
    LoginPageUrl = "http://example.com/login",
    ApprovedCallbackUrls = new List<string> { "example.com" },
};

try
{
    await descopeClient.Mgmt.V1.Thirdparty.App.Update.PostAsync(updateRequest);
}
catch (DescopeException ex)
{
    // Handle the error
}

Patch Inbound Application

This operation updates only the provided fields of an inbound application.

// Args:
//   id (String): App ID (required)
//   name (String): Optional name
//   description (String): Optional description
//   logo (String): Optional logo URL
//   loginPageUrl (String): Optional login page URL
//   approvedCallbackUrls (String[]): Optional list of approved callback URLs
//   permissionsScopes (InboundAppScope[]): Optional array of permission scopes
//   attributesScopes (InboundAppScope[]): Optional array of attribute scopes

await descopeClient.management.inboundApplication.patchApplication({
  id: 'app-id',
  description: 'my updated desc',
  logo: 'data:image/png;..',
  loginPageUrl: 'http://example.com/login',
});
# Args:
#   id (str): App ID (required)
#   Additional fields are optional and only provided fields are updated

try:
    descope_client.mgmt.third_party_application.patch(
        id='app-id',
        description='my updated desc',
        logo='data:image/png;..',
        login_page_url='http://example.com/login',
    )
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    req (*descope.ThirdPartyApplicationRequest): App ID plus any fields to update

ctx := context.Background()

req := &descope.ThirdPartyApplicationRequest{
    ID:           "app-id",
    Description:  "my updated desc",
    Logo:         "data:image/png;..",
    LoginPageURL: "http://example.com/login",
}

err := descopeClient.Management.ThirdPartyApplication().PatchApplication(ctx, req)
if err != nil {
    // Handle the error
}
// Args:
//   id (String): App ID (required)
//   name (String): Optional name
//   description (String): Optional description
//   logo (String): Optional logo URL
//   loginPageUrl (String): Optional login page URL
try {
    inboundAppsService.patchApplication(
        InboundAppRequest.builder()
            .id("app-id")
            // .name("Patched Name")
            // .description("optional-description")
            // .logo("optional-logo")
            // .loginPageUrl("optional-loginPageUrl")
            .build()
    );
} catch (DescopeException de) {
    // Handle the error
}
# Args:
#   id: App ID (required)
#   Additional fields are optional and only provided fields are updated

descope_client.patch_application(
  id: 'app-id',
  description: 'my updated desc',
  logo: 'data:image/png;..',
  login_page_url: 'http://example.com/login',
)
// Args:
//   patchRequest (PatchThirdPartyApplicationRequest): App ID plus any fields to update

var patchRequest = new PatchThirdPartyApplicationRequest
{
    Id = "app-id",
    Description = "my updated desc",
    Logo = "data:image/png;..",
    LoginPageUrl = "http://example.com/login",
};

try
{
    await descopeClient.Mgmt.V1.Thirdparty.App.PatchPath.PostAsync(patchRequest);
}
catch (DescopeException ex)
{
    // Handle the error
}

Delete Inbound Application

This operation deletes an inbound application by its ID.

TriangleAlert

Note

This action is irreversible. Use carefully.

// Args: id (String): App ID

await descopeClient.management.inboundApplication.deleteApplication('app-id');
try:
    descope_client.mgmt.third_party_application.delete(id='app-id')
except AuthException as error:
    # Handle the error
    print(error)
ctx := context.Background()

err := descopeClient.Management.ThirdPartyApplication().DeleteApplication(ctx, "app-id")
if err != nil {
    // Handle the error
}
try {
    inboundAppsService.deleteApplication("app-id");
} catch (DescopeException de) {
    // Handle the error
}
descope_client.delete_application('app-id')
try
{
    await descopeClient.Mgmt.V1.Thirdparty.App.DeletePath.PostAsync(
        new DeleteThirdPartyApplicationRequest { Id = "app-id" }
    );
}
catch (DescopeException ex)
{
    // Handle the error
}

Delete Inbound Applications (Batch)

This operation deletes multiple inbound applications in a single request.

TriangleAlert

Note

This action is irreversible. Use carefully.

// Args:
//   appIds (String[]): Array of inbound app IDs to delete

await descopeClient.management.inboundApplication.deleteApplicationBatch(['app-id-1', 'app-id-2']);
# Args:
#   ids (List[str]): Array of inbound app IDs to delete

try:
    descope_client.mgmt.third_party_application.delete_batch(ids=['app-id-1', 'app-id-2'])
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    appIDs ([]string): Array of inbound app IDs to delete

ctx := context.Background()

err := descopeClient.Management.ThirdPartyApplication().DeleteApplicationBatch(ctx, []string{"app-id-1", "app-id-2"})
if err != nil {
    // Handle the error
}

Load Inbound Application

This operation loads a specific inbound application by its ID.

// Args: id (String): App ID

const { data: app } =
  await descopeClient.management.inboundApplication.loadApplication('app-id');
try:
    resp = descope_client.mgmt.third_party_application.load(id='app-id')
    app = resp['app']
except AuthException as error:
    # Handle the error
    print(error)
ctx := context.Background()

app, err := descopeClient.Management.ThirdPartyApplication().LoadApplication(ctx, "app-id")
if err != nil {
    // Handle the error
}
try {
    InboundApp app = inboundAppsService.loadApplication("app-id");
} catch (DescopeException de) {
    // Handle the error
}
resp = descope_client.load_application('app-id')
app = resp['app']
try
{
    var loadResponse = await descopeClient.Mgmt.V1.Thirdparty.App.Load.GetWithIdAsync("app-id");
}
catch (DescopeException ex)
{
    // Handle the error
}

Load Inbound Application by Client ID

This operation loads a specific inbound application by its client ID.

try {
    InboundApp app = inboundAppsService.loadApplicationByClientId("client-id");
} catch (DescopeException de) {
    // Handle the error
}
try
{
    var loadResponse = await descopeClient.Mgmt.V1.Thirdparty.App.Load.GetWithClientIdAsync("client-id");
}
catch (DescopeException ex)
{
    // Handle the error
}

Get Inbound Application Secret

This operation retrieves the application's secret by its ID.

// Args: id (String): App ID

const {
  data: { cleartext: secret },
} = await descopeClient.management.inboundApplication.getApplicationSecret('app-id');
try:
    resp = descope_client.mgmt.third_party_application.get_secret(id='app-id')
    secret = resp['cleartext']
except AuthException as error:
    # Handle the error
    print(error)
ctx := context.Background()

secret, err := descopeClient.Management.ThirdPartyApplication().GetApplicationSecret(ctx, "app-id")
if err != nil {
    // Handle the error
}
try {
    String secret = inboundAppsService.getApplicationSecret("app-id");
} catch (DescopeException de) {
    // Handle the error
}
resp = descope_client.get_application_secret('app-id')
secret = resp['cleartext']
try
{
    var secretResponse = await descopeClient.Mgmt.V1.Thirdparty.App.Secret.GetAsync(config =>
    {
        config.QueryParameters.Id = "app-id";
    });
    var secret = secretResponse.Cleartext;
}
catch (DescopeException ex)
{
    // Handle the error
}

Rotate Inbound Application Secret

This operation rotates the application's secret and returns the new secret.

// Args: id (String): App ID

const {
  data: { cleartext: newSecret },
} = await descopeClient.management.inboundApplication.rotateApplicationSecret('app-id');
try:
    resp = descope_client.mgmt.third_party_application.rotate_secret(id='app-id')
    new_secret = resp['cleartext']
except AuthException as error:
    # Handle the error
    print(error)
ctx := context.Background()

newSecret, err := descopeClient.Management.ThirdPartyApplication().RotateApplicationSecret(ctx, "app-id")
if err != nil {
    // Handle the error
}
try {
    String newSecret = inboundAppsService.rotateApplicationSecret("app-id");
} catch (DescopeException de) {
    // Handle the error
}
resp = descope_client.rotate_application_secret('app-id')
new_secret = resp['cleartext']
try
{
    var rotateResponse = await descopeClient.Mgmt.V1.Thirdparty.App.Rotate.PostAsync(
        new RotateThirdPartyApplicationSecretRequest { Id = "app-id" }
    );
    var newSecret = rotateResponse.Cleartext;
}
catch (DescopeException ex)
{
    // Handle the error
}

Load All Inbound Applications

This operation loads all inbound applications in the project.

const { data: apps } =
  await descopeClient.management.inboundApplication.loadAllApplications();
apps.forEach((app) => {
  // Do something
});
try:
    resp = descope_client.mgmt.third_party_application.load_all()
    apps = resp['apps']
    for app in apps:
        # Do something
        pass
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    options (*descope.ThirdPartyApplicationSearchOptions): Optional pagination (Page, Limit)

ctx := context.Background()

apps, total, err := descopeClient.Management.ThirdPartyApplication().LoadAllApplications(ctx, &descope.ThirdPartyApplicationSearchOptions{
    Page:  0,
    Limit: 100,
})
if err != nil {
    // Handle the error
} else {
    for _, app := range apps {
        // Do something
    }
}
try {
    InboundApp[] apps = inboundAppsService.loadAllApplications();
    for (InboundApp app : apps) {
        // Do something
    }
} catch (DescopeException de) {
    // Handle the error
}
resp = descope_client.load_all_applications
apps = resp['apps']
apps.each do |app|
  # Do something
end
try
{
    var loadAllResponse = await descopeClient.Mgmt.V1.Thirdparty.Apps.Load.GetAsync(config =>
    {
        config.QueryParameters.Page = 0;
        config.QueryParameters.Limit = 100;
    });
    foreach (var app in loadAllResponse.Apps)
    {
        // Do something
    }
}
catch (DescopeException ex)
{
    // Handle the error
}

Search and revoke user or tenant consents granted to inbound apps. For the Console consent view, see Managing User Consent.

Delete User Consents for Inbound App

This operation deletes user consents for an inbound app. At least one identifying field must be set.

// Args:
//   consentIds (String[]): Optional array of consent IDs to delete
//   appId (String): Optional inbound app ID
//   userIds (String[]): Optional array of user IDs
// At least one of consentIds, appId, or userIds must be provided

await descopeClient.management.inboundApplication.deleteConsents({
  userIds: ['user-id-1'],
});
# Args:
#   consent_ids (List[str]): Optional array of consent IDs to delete
#   app_id (str): Optional inbound app ID
#   user_ids (List[str]): Optional array of user IDs
#   tenant_id (str): Optional tenant ID
# At least one identifying field must be provided

try:
    descope_client.mgmt.third_party_application.delete_consents(user_ids=['user-id-1'])
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    options (*descope.ThirdPartyApplicationConsentDeleteOptions): At least one of ConsentIDs, AppID, or UserIDs must be set

ctx := context.Background()

err := descopeClient.Management.ThirdPartyApplication().DeleteConsents(ctx, &descope.ThirdPartyApplicationConsentDeleteOptions{
    UserIDs: []string{"user-id-1"},
})
if err != nil {
    // Handle the error
}
// Args:
//   consentIds (String[]): Optional array of consent IDs to delete
//   appId (String): Optional inbound app ID
//   userIds (String[]): Optional array of user IDs
//   tenantId (String): Optional tenant ID
// At least one identifying field must be provided
try {
    inboundAppsService.deleteConsents(
        InboundAppConsentDeleteOptions.builder()
            .userIds(new String[] { "user-id-1" })
            // .consentIds(new String[] { "consent-id-1", "consent-id-2" })
            // .appId("app-id")
            // .tenantId("tenant-id")
            .build()
    );
} catch (DescopeException de) {
    // Handle the error
}
# Args:
#   consent_ids: Optional array of consent IDs to delete
#   app_id: Optional inbound app ID
#   user_ids: Optional array of user IDs
#   tenant_id: Optional tenant ID
# At least one identifying field must be provided

descope_client.delete_consents(app_id: 'app-id', user_ids: ['user-id-1'])
// Args:
//   ConsentIds (List<string>): Optional array of consent IDs to delete
//   AppId (String): Optional inbound app ID
//   UserIds (List<string>): Optional array of user IDs
// At least one identifying field must be provided

try
{
    await descopeClient.Mgmt.V1.Thirdparty.Consents.DeletePath.PostAsync(
        new DeleteThirdPartyApplicationConsentsRequest
        {
            UserIds = new List<string> { "user-id-1" },
        }
    );
}
catch (DescopeException ex)
{
    // Handle the error
}

Delete Tenant Consents for Inbound App

This operation deletes tenant consents for an inbound app. At least one identifying field must be set.

// Args:
//   consentIds (String[]): Optional array of tenant consent IDs to delete
//   appId (String): Optional inbound app ID
//   tenantId (String): Optional tenant ID
// At least one of consentIds, appId, or tenantId must be provided

await descopeClient.management.inboundApplication.deleteTenantConsents({
  tenantId: 'tenant-id',
});
# Args:
#   tenant_id (str): Tenant ID
# Note: The current Python SDK accepts only tenant_id for this operation.

try:
    descope_client.mgmt.third_party_application.delete_tenant_consents(tenant_id='tenant-id')
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    options (*descope.ThirdPartyApplicationTenantConsentDeleteOptions): At least one of ConsentIDs, AppID, or TenantID must be set

ctx := context.Background()

err := descopeClient.Management.ThirdPartyApplication().DeleteTenantConsents(ctx, &descope.ThirdPartyApplicationTenantConsentDeleteOptions{
    TenantID: "tenant-id",
})
if err != nil {
    // Handle the error
}
// Args:
//   consentIds (String[]): Optional array of tenant consent IDs to delete
//   appId (String): Optional inbound app ID
//   tenantId (String): Optional tenant ID
// At least one identifying field must be provided
try {
    inboundAppsService.deleteTenantConsents(
        InboundAppTenantConsentDeleteOptions.builder()
            .tenantId("tenant-id")
            // .consentIds(new String[] { "consent-id-1", "consent-id-2" })
            // .appId("app-id")
            .build()
    );
} catch (DescopeException de) {
    // Handle the error
}
descope_client.delete_tenant_consents(tenant_id: 'tenant-id')
// Args:
//   ConsentIds (List<string>): Optional array of tenant consent IDs to delete
//   AppId (String): Optional inbound app ID
//   TenantId (String): Optional tenant ID
// At least one identifying field must be provided

try
{
    await descopeClient.Mgmt.V1.Thirdparty.Consents.Delete.Tenant.PostAsync(
        new DeleteThirdPartyApplicationTenantConsentsRequest
        {
            TenantId = "tenant-id",
        }
    );
}
catch (DescopeException ex)
{
    // Handle the error
}

Search Consents for Inbound Apps

This operation searches consents for inbound apps. All fields are optional and can be used to filter results.

Note

The Ruby SDK does not currently support searching consents. Use the Search consents Management API instead.

// Args:
//   appId (String): Optional inbound app ID to filter by
//   userId (String): Optional user ID to filter by
//   consentId (String): Optional consent ID to filter by
//   page (Number): Optional page number for pagination

const { data: consents } =
  await descopeClient.management.inboundApplication.searchConsents({
    appId: 'app-id',
    page: 2,
  });
# Args:
#   app_id (str): Optional inbound app ID to filter by
#   user_id (str): Optional user ID to filter by
#   consent_id (str): Optional consent ID to filter by
#   tenant_id (str): Optional tenant ID to filter by
#   page (int): Optional page number for pagination

try:
    resp = descope_client.mgmt.third_party_application.search_consents(
        app_id='app-id',
        page=2,
    )
    consents = resp['consents']
except AuthException as error:
    # Handle the error
    print(error)
// Args:
//    ctx: context.Context
//    options (*descope.ThirdPartyApplicationConsentSearchOptions): Optional filters (AppID, UserID, ConsentID, Page)

ctx := context.Background()

consents, total, err := descopeClient.Management.ThirdPartyApplication().SearchConsents(ctx, &descope.ThirdPartyApplicationConsentSearchOptions{
    AppID: "app-id",
    Page:  2,
})
if err != nil {
    // Handle the error
}
// Args:
//   appId (String): Optional inbound app ID to filter by
//   userId (String): Optional user ID to filter by
//   consentId (String): Optional consent ID to filter by
//   tenantId (String): Optional tenant ID to filter by
//   page (String): Optional page token for pagination
try {
    InboundAppConsentSearchResponse res = inboundAppsService.searchConsents(
        InboundAppConsentSearchOptions.builder()
            .appId("app-id")
            .page("page-token")
            // .userId("user-id")
            // .consentId("consent-id")
            // .tenantId("tenant-id")
            .build()
    );
    // res.getConsents(), res.getTotal()
} catch (DescopeException de) {
    // Handle the error
}
// Args:
//   AppId (String): Optional inbound app ID to filter by
//   UserId (String): Optional user ID to filter by
//   ConsentId (String): Optional consent ID to filter by
//   Page (int): Optional page number for pagination

try
{
    var searchResponse = await descopeClient.Mgmt.V1.Thirdparty.Consents.Search.PostAsync(
        new SearchThirdPartyApplicationConsentsRequest
        {
            AppId = "app-id",
            Page = 2,
        }
    );
}
catch (DescopeException ex)
{
    // Handle the error
}
Was this helpful?

On this page