Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Bars92 committed Dec 22, 2024
1 parent 7bceb59 commit d13a2fc
Showing 1 changed file with 69 additions and 7 deletions.
76 changes: 69 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,29 +622,29 @@ await descopeClient.management.password.configureSettings('my-tenant-id', {
You can create, update, delete or load SSO applications:

```typescript
// Create OIDC sso application
// Create OIDC SSO application
await descopeClient.management.ssoApplication.createOidcApplication({
name: 'My OIDC app name',
loginPageUrl: 'http://dummy.com/login',
});

// Create SAML sso application
// Create SAML SSO application
await descopeClient.management.ssoApplication.createSamlApplication({
name: 'My SAML app name',
loginPageUrl: 'http://dummy.com/login',
useMetadataInfo: true,
metadataUrl: 'http://dummy.com/metadata',
});

// Update OIDC sso application.
// Update OIDC SSO application.
// Update will override all fields as is. Use carefully.
await descopeClient.management.ssoApplication.updateOidcApplication({
id: 'my-app-id',
name: 'My OIDC app name',
loginPageUrl: 'http://dummy.com/login',
});

// Update SAML sso application.
// Update SAML SSO application.
// Update will override all fields as is. Use carefully.
await descopeClient.management.ssoApplication.updateSamlApplication({
id: 'my-app-id',
Expand All @@ -657,13 +657,13 @@ await descopeClient.management.ssoApplication.updateSamlApplication({
certificate: 'certificate',
});

// Tenant deletion cannot be undone. Use carefully.
// SSO application deletion cannot be undone. Use carefully.
await descopeClient.management.ssoApplication.delete('my-app-id');

// Load sso application by id
// Load SSO application by id
const app = await descopeClient.management.ssoApplication.load('my-app-id');

// Load all sso applications
// Load all SSO applications
const appsRes = await descopeClient.management.ssoApplication.loadAll();
appsRes.data.forEach((app) => {
// do something
Expand Down Expand Up @@ -1193,6 +1193,68 @@ const relations = await descopeClient.management.fga.check([
]);
```

### Manage Third Party Aplications

You can create, update, delete or load third party applications:

```typescript
// Create a third party application.
const { id, cleartext: secret } =
await descopeClient.management.thirdPartyApplication.createApplication({
name: 'my new app',
description: 'my desc',
logo: 'data:image/png;..',
approvedCallbackUrls: ['dummy.com'],
permissionsScopes: [
{
name: 'read_support',
description: 'read for support',
values: ['Support'],
},
],
attributesScopes: [
{
name: 'read_email',
description: 'read user email',
values: ['email'],
},
],
loginPageUrl: 'http://dummy.com/login',
});

// Update a third party application.
// Update will override all fields as is. Use carefully.
await descopeClient.management.thirdPartyApplication.updateApplication({
name: 'my updated app',
loginPageUrl: 'http://dummy.com/login',
approvedCallbackUrls: ['dummy.com', 'myawesomedomain.com'],
});

// third party application deletion cannot be undone. Use carefully.
await descopeClient.management.thirdPartyApplication.deleteApplication('my-app-id');

// Load third party application by id
const app = await descopeClient.management.thirdPartyApplication.loadApplication('my-app-id');

// Load all third party applications
const appsRes = await descopeClient.management.thirdPartyApplication.loadAllApplications();
appsRes.data.forEach((app) => {
// do something
});

// Search in all consents. search consents by the given app id and offset to the third page.
const consentsRes = await descopeClient.management.thirdPartyApplication.searchConsents({
appId: 'my-app',
page: 2,
});

// Delete consents. delete all user consents.
// third party application consents deletion cannot be undone. Use carefully.
await descopeClient.management.thirdPartyApplication.deleteConsents({
userIds: ['user'],
});
```

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

To ease your e2e tests, we exposed dedicated management methods,
Expand Down

0 comments on commit d13a2fc

Please sign in to comment.