@@ -73,6 +73,7 @@ These sections show how to use the SDK to perform permission and user management
737313 . [ Manage FGA (Fine-grained Authorization)] ( #manage-fga-fine-grained-authorization )
747414 . [ Manage Project] ( #manage-project )
757515 . [ Manage SSO Applications] ( #manage-sso-applications )
76+ 16 . [ Manage Outbound Applications] ( #manage-outbound-applications )
7677
7778If you wish to run any of our code samples and play with them, check out our [ Code Examples] ( #code-examples ) section.
7879
@@ -1301,6 +1302,61 @@ apps = apps_resp["apps"]
13011302 # Do something
13021303```
13031304
1305+ ### Manage Outbound Applications
1306+
1307+ You can create, update, delete or load outbound applications, as well as manage user tokens:
1308+
1309+ ``` python
1310+ # Create OIDC outbound application
1311+ descope_client.mgmt.outbound_application.create_application(
1312+ name = " My Google App" ,
1313+ client_id = " google-client-id" ,
1314+ client_secret = " google-client-secret" ,
1315+ template_id = " google" , # Use pre-configured Google template
1316+ default_scopes = [" openid" , " profile" , " email" ],
1317+ pkce = True ,
1318+ access_type = " offline" ,
1319+ )
1320+
1321+ # Update outbound application
1322+ # Update will override all fields as is. Use carefully.
1323+ descope_client.mgmt.outbound_application.update_application(
1324+ id = " app-id" ,
1325+ name = " My Updated Google App" ,
1326+ client_id = " updated-client-id" ,
1327+ description = " Updated description" ,
1328+ default_scopes = [" openid" , " profile" ],
1329+ )
1330+
1331+ # Outbound application deletion cannot be undone. Use carefully.
1332+ descope_client.mgmt.outbound_application.delete_application(" app-id" )
1333+
1334+ # Load outbound application by id
1335+ app_resp = descope_client.mgmt.outbound_application.load_application(" app-id" )
1336+
1337+ # Load all outbound applications
1338+ apps_resp = descope_client.mgmt.outbound_application.load_all_applications()
1339+ apps = apps_resp[" apps" ]
1340+ for app in apps:
1341+ # Do something
1342+
1343+ # Fetch user token for outbound application
1344+ token_resp = descope_client.mgmt.outbound_application.fetch_outbound_app_user_token(
1345+ user_id = " user-id" ,
1346+ app_id = " app-id" ,
1347+ scopes = [" openid" , " profile" ],
1348+ )
1349+
1350+ # Delete specific token by ID
1351+ descope_client.mgmt.outbound_application.delete_outbound_app_token_by_id(" token-id" )
1352+
1353+ # Delete all user tokens for a specific app
1354+ descope_client.mgmt.outbound_application.delete_outbound_app_user_tokens(
1355+ user_id = " user-id" ,
1356+ app_id = " app-id" ,
1357+ )
1358+ ```
1359+
13041360### Utils for your end to end (e2e) tests and integration tests
13051361
13061362To ease your e2e tests, we exposed dedicated management methods,
0 commit comments