Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ These sections show how to use the SDK to perform permission and user management
13. [Manage FGA (Fine-grained Authorization)](#manage-fga-fine-grained-authorization)
14. [Manage Project](#manage-project)
15. [Manage SSO Applications](#manage-sso-applications)
16. [Manage Outbound Applications](#manage-outbound-applications)

If you wish to run any of our code samples and play with them, check out our [Code Examples](#code-examples) section.

Expand Down Expand Up @@ -1301,6 +1302,61 @@ apps = apps_resp["apps"]
# Do something
```

### Manage Outbound Applications

You can create, update, delete or load outbound applications, as well as manage user tokens:

```python
# Create OIDC outbound application
descope_client.mgmt.outbound_application.create_application(
name="My Google App",
client_id="google-client-id",
client_secret="google-client-secret",
template_id="google", # Use pre-configured Google template
default_scopes=["openid", "profile", "email"],
pkce=True,
access_type="offline",
)

# Update outbound application
# Update will override all fields as is. Use carefully.
descope_client.mgmt.outbound_application.update_application(
id="app-id",
name="My Updated Google App",
client_id="updated-client-id",
description="Updated description",
default_scopes=["openid", "profile"],
)

# Outbound application deletion cannot be undone. Use carefully.
descope_client.mgmt.outbound_application.delete_application("app-id")

# Load outbound application by id
app_resp = descope_client.mgmt.outbound_application.load_application("app-id")

# Load all outbound applications
apps_resp = descope_client.mgmt.outbound_application.load_all_applications()
apps = apps_resp["apps"]
for app in apps:
# Do something
Comment on lines +1340 to +1341
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation for this for loop is inconsistent with the rest of the code block. It should be indented at the same level as the previous line to maintain proper Python syntax.

Suggested change
for app in apps:
# Do something
for app in apps:
# Do something

Copilot uses AI. Check for mistakes.

# Fetch user token for outbound application
token_resp = descope_client.mgmt.outbound_application.fetch_outbound_app_user_token(
user_id="user-id",
app_id="app-id",
scopes=["openid", "profile"],
)

# Delete specific token by ID
descope_client.mgmt.outbound_application.delete_outbound_app_token_by_id("token-id")

# Delete all user tokens for a specific app
descope_client.mgmt.outbound_application.delete_outbound_app_user_tokens(
user_id="user-id",
app_id="app-id",
)
```

### Utils for your end to end (e2e) tests and integration tests

To ease your e2e tests, we exposed dedicated management methods,
Expand Down
10 changes: 10 additions & 0 deletions descope/management/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ class MgmtV1:
project_import = "/v1/mgmt/project/import"
project_list_projects = "/v1/mgmt/projects/list"

# outbound application
outbound_application_create_path = "/v1/mgmt/outbound/application/create"
outbound_application_update_path = "/v1/mgmt/outbound/application/update"
outbound_application_delete_path = "/v1/mgmt/outbound/application/delete"
outbound_application_load_path = "/v1/mgmt/outbound/application/load"
outbound_application_load_all_path = "/v1/mgmt/outbound/application/all"
outbound_application_fetch_user_token_path = "/v1/mgmt/outbound/application/token/fetch"
outbound_application_delete_token_by_id_path = "/v1/mgmt/outbound/application/token/delete"
outbound_application_delete_user_tokens_path = "/v1/mgmt/outbound/application/user/tokens/delete"


class MgmtSignUpOptions:
def __init__(
Expand Down
Loading
Loading