Skip to content
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,8 @@ You can create, update, delete or load outbound applications:

```typescript
// Create an outbound application.
// For DCR-based apps (e.g. custom MCP servers that support RFC 7591 dynamic
// client registration), pass `useDcr: true` and `dcrUrl`.
const { id } =
await descopeClient.management.outboundApplication.createApplication({
name: 'my new app',
Expand Down
38 changes: 38 additions & 0 deletions lib/management/outboundapplication.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,44 @@ describe('Management OutboundApplication', () => {
response: httpResponse,
});
});

it('should pass through DCR fields (useDcr/dcrUrl) without a cast', async () => {
const httpResponse = {
ok: true,
json: () => mockOutboundApplicationResponse,
clone: () => ({
json: () => Promise.resolve(mockOutboundApplicationResponse),
}),
status: 200,
};
mockHttpClient.post.mockResolvedValue(httpResponse);

const resp: SdkResponse<OutboundApplication> =
await management.outboundApplication.createApplication({
name: 'dcr app',
description: 'custom MCP server with dynamic client registration',
useDcr: true,
dcrUrl: 'https://mcp.example.com/register',
pkce: true,
defaultRedirectUrl: 'https://api.descope.com/v1/outbound/oauth/callback',
});

expect(mockHttpClient.post).toHaveBeenCalledWith(apiPaths.outboundApplication.create, {
name: 'dcr app',
description: 'custom MCP server with dynamic client registration',
useDcr: true,
dcrUrl: 'https://mcp.example.com/register',
pkce: true,
defaultRedirectUrl: 'https://api.descope.com/v1/outbound/oauth/callback',
});

expect(resp).toEqual({
code: 200,
data: mockOutboundApplicationResponse.app,
ok: true,
response: httpResponse,
});
});
});

describe('createOutboundApplicationByTemplate', () => {
Expand Down
2 changes: 2 additions & 0 deletions lib/management/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ export type OutboundApplication = {
pkce?: boolean;
accessType?: AccessType;
prompt?: Array<PromptType>;
useDcr?: boolean;
dcrUrl?: string;
};

// Fields of an outbound application that can override a template's
Expand Down
Loading