Skip to content

Commit 28bddf9

Browse files
authored
Add SAML IDP logout url (+DefaultRelayState +ForceAuthentication) (#381)
* Add SAML IDP logout url (+DefaultRelayState +ForceAuthentication) * Fix tests
1 parent f34368b commit 28bddf9

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Diff for: lib/management/ssoapplication.test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ const mockSSOApplications = [
4242
acsAllowedCallbacks: [],
4343
subjectNameIdType: '',
4444
subjectNameIdFormat: '',
45+
defaultRelayState: 'rs',
46+
forceAuthentication: false,
47+
idpLogoutUrl: 'http://dummyidp.com/logout',
48+
logoutRedirectUrl: 'http://dummy.com/logout',
4549
},
4650
oidcSettings: null,
4751
},
@@ -57,6 +61,7 @@ const mockSSOApplications = [
5761
loginPageUrl: 'http://dummy.com/login',
5862
issuer: 'http://dummy.com/issuer',
5963
discoveryUrl: 'http://dummy/discovery',
64+
forceAuthentication: true,
6065
},
6166
},
6267
];
@@ -87,6 +92,7 @@ describe('Management SSOApplication', () => {
8792
await management.ssoApplication.createOidcApplication({
8893
name: 'name',
8994
loginPageUrl: 'http://dummy.com',
95+
forceAuthentication: true,
9096
});
9197

9298
expect(mockHttpClient.post).toHaveBeenCalledWith(
@@ -98,6 +104,7 @@ describe('Management SSOApplication', () => {
98104
description: undefined,
99105
enabled: true,
100106
logo: undefined,
107+
forceAuthentication: true,
101108
},
102109
{ token: 'key' },
103110
);
@@ -129,6 +136,9 @@ describe('Management SSOApplication', () => {
129136
loginPageUrl: 'http://dummy.com',
130137
useMetadataInfo: true,
131138
metadataUrl: 'http://dummy.com/metadata',
139+
defaultRelayState: 'rs',
140+
forceAuthentication: true,
141+
logoutRedirectUrl: 'http://dummy.com/logout',
132142
});
133143

134144
expect(mockHttpClient.post).toHaveBeenCalledWith(
@@ -150,6 +160,9 @@ describe('Management SSOApplication', () => {
150160
acsAllowedCallbacks: undefined,
151161
subjectNameIdType: undefined,
152162
subjectNameIdFormat: undefined,
163+
defaultRelayState: 'rs',
164+
forceAuthentication: true,
165+
logoutRedirectUrl: 'http://dummy.com/logout',
153166
},
154167
{ token: 'key' },
155168
);
@@ -242,6 +255,7 @@ describe('Management SSOApplication', () => {
242255
description: undefined,
243256
enabled: false,
244257
logo: undefined,
258+
forceAuthentication: undefined,
245259
},
246260
{ token: 'key' },
247261
);
@@ -295,6 +309,9 @@ describe('Management SSOApplication', () => {
295309
acsAllowedCallbacks: undefined,
296310
subjectNameIdType: undefined,
297311
subjectNameIdFormat: undefined,
312+
defaultRelayState: undefined,
313+
forceAuthentication: undefined,
314+
logoutRedirectUrl: undefined,
298315
},
299316
{ token: 'key' },
300317
);

Diff for: lib/management/types.ts

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export type OidcApplicationOptions = {
2929
description?: string;
3030
logo?: string;
3131
enabled?: boolean;
32+
forceAuthentication?: boolean;
3233
};
3334

3435
/**
@@ -53,6 +54,9 @@ export type SamlApplicationOptions = {
5354
acsAllowedCallbacks?: string[];
5455
subjectNameIdType?: string;
5556
subjectNameIdFormat?: string;
57+
defaultRelayState?: string;
58+
forceAuthentication?: boolean;
59+
logoutRedirectUrl?: string;
5660
};
5761

5862
/**
@@ -185,6 +189,7 @@ export type SSOApplicationOIDCSettings = {
185189
loginPageUrl: string;
186190
issuer: string;
187191
discoveryUrl: string;
192+
forceAuthentication: boolean;
188193
};
189194

190195
/** Represents SAML settings of an SSO application in a project. */
@@ -204,6 +209,10 @@ export type SSOApplicationSAMLSettings = {
204209
acsAllowedCallbacks: string[];
205210
subjectNameIdType: string;
206211
subjectNameIdFormat: string;
212+
defaultRelayState: string;
213+
forceAuthentication: boolean;
214+
idpLogoutUrl: string;
215+
logoutRedirectUrl: string;
207216
};
208217

209218
/** Represents an SSO application in a project. */

0 commit comments

Comments
 (0)