Skip to content

Commit a8f00a8

Browse files
authored
Add the ability to pass email and templateId parameters to generateSSOConfigurationLink (#439)
1 parent 8b595b6 commit a8f00a8

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,9 @@ await descopeClient.management.tenant.configureSettings('my-tenant-id', {
586586
InactivityTimeUnit: 'minutes',
587587
});
588588

589-
// Generate tenant admin self service link for SSO configuration (valid for 24 hours)
589+
// Generate tenant admin self service link for SSO Suite (valid for 24 hours)
590590
// ssoId can be provided for a specific sso configuration
591+
// email can be provided to send the link to (email's templateId can be provided as well)
591592
const res = await descopeClient.management.tenant.generateSSOConfigurationLink(
592593
'my-tenant-id',
593594
60 * 60 * 24,

lib/management/tenant.test.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,23 @@ describe('Management Tenant', () => {
331331
mockHttpClient.post.mockResolvedValue(httpResponse);
332332

333333
const resp: SdkResponse<GenerateSSOConfigurationLinkResponse> =
334-
await management.tenant.generateSSOConfigurationLink('test', 60 * 60 * 24, 'some-ssoid');
334+
await management.tenant.generateSSOConfigurationLink(
335+
'test',
336+
60 * 60 * 24,
337+
'some-ssoid',
338+
339+
'some-template-id',
340+
);
335341

336342
expect(mockHttpClient.post).toHaveBeenCalledWith(
337343
apiPaths.tenant.generateSSOConfigurationLink,
338-
{ tenantId: 'test', expireTime: 60 * 60 * 24, ssoId: 'some-ssoid' },
344+
{
345+
tenantId: 'test',
346+
expireTime: 60 * 60 * 24,
347+
ssoId: 'some-ssoid',
348+
349+
templateId: 'some-template-id',
350+
},
339351
{
340352
token: 'key',
341353
},

lib/management/tenant.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ const withTenant = (sdk: CoreSdk, managementKey?: string) => ({
112112
tenantId: string,
113113
expireDuration: number,
114114
ssoId?: string,
115+
email?: string,
116+
templateId?: string,
115117
): Promise<SdkResponse<GenerateSSOConfigurationLinkResponse>> =>
116118
transformResponse<GenerateSSOConfigurationLinkResponse, GenerateSSOConfigurationLinkResponse>(
117119
sdk.httpClient.post(
118120
apiPaths.tenant.generateSSOConfigurationLink,
119-
{ tenantId, expireTime: expireDuration, ssoId },
121+
{ tenantId, expireTime: expireDuration, ssoId, email, templateId },
120122
{
121123
token: managementKey,
122124
},

0 commit comments

Comments
 (0)