Skip to content

Commit 02189f6

Browse files
authored
Added Support for SS-SSO-FF for Node Auth0 (#1093)
2 parents 7f82bab + e2e2565 commit 02189f6

File tree

3 files changed

+153
-21
lines changed

3 files changed

+153
-21
lines changed

src/management/__generated/managers/connections-manager.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
PostScimToken201Response,
1414
PostScimTokenRequest,
1515
GetConnections200ResponseOneOf,
16+
ConnectionForList,
1617
DeleteConnectionsByIdRequest,
1718
DeleteScimConfigurationRequest,
1819
DeleteTokensByTokenIdRequest,
@@ -148,24 +149,26 @@ export class ConnectionsManager extends BaseAPI {
148149
}
149150

150151
/**
151-
* Retrieves every connection matching the specified strategy. All connections are retrieved if no strategy is being specified. Accepts a list of fields to include or exclude in the resulting list of connection objects.
152+
* Retrieves detailed list of all <a href="https://auth0.com/docs/authenticate/identity-providers">connections</a> that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
153+
*
152154
* This endpoint supports two types of pagination:
153-
* - Offset pagination
154-
* - Checkpoint pagination
155+
* <ul>
156+
* <li>Offset pagination</li>
157+
* <li>Checkpoint pagination</li>
158+
* </ul>
155159
*
156-
* Checkpoint pagination should be used if you need to retrieve more than 1000 connections.
160+
* Checkpoint pagination must be used if you need to retrieve more than 1000 connections.
157161
*
158162
* <h2>Checkpoint Pagination</h2>
159163
*
160164
* To search by checkpoint, use the following parameters:
161-
* - from: Optional id from which to start selection.
162-
* - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
165+
* <ul>
166+
* <li><code>from</code>: Optional id from which to start selection.</li>
167+
* <li><code>take</code>: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li>
168+
* </ul>
163169
*
164-
* The first time you call this endpoint using Checkpoint Pagination, you should omit the <code>from</code> parameter.
165-
* If there are more results, a <code>next</code> value will be included in the response. You can use this for subsequent API calls.
166-
* When <code>next</code> is no longer included in the response, this indicates there are no more pages remaining.
170+
* <b>Note</b>: The first time you call this endpoint using checkpoint pagination, omit the <code>from</code> parameter. If there are more results, a <code>next</code> value is included in the response. You can use this for subsequent API calls. When <code>next</code> is no longer included in the response, no pages are remaining.
167171
*
168-
* Note: The <code>include_totals</code> parameter is not supported when using checkpoint pagination.
169172
* Get all connections
170173
*
171174
* @throws {RequiredError}
@@ -177,7 +180,7 @@ export class ConnectionsManager extends BaseAPI {
177180
async getAll(
178181
requestParameters?: GetConnectionsRequest,
179182
initOverrides?: InitOverride
180-
): Promise<ApiResponse<Array<Connection>>>;
183+
): Promise<ApiResponse<Array<ConnectionForList>>>;
181184
async getAll(
182185
requestParameters: GetConnectionsRequest = {},
183186
initOverrides?: InitOverride
@@ -237,8 +240,7 @@ export class ConnectionsManager extends BaseAPI {
237240
}
238241

239242
/**
240-
* Retrieves a connection by its <code>ID</code>.
241-
*
243+
* Retrieve details for a specified <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a> along with options that can be used for identity provider configuration.
242244
* Get a connection
243245
*
244246
* @throws {RequiredError}
@@ -380,8 +382,9 @@ export class ConnectionsManager extends BaseAPI {
380382
}
381383

382384
/**
383-
* <b>Note:</b> if you use the options parameter, the whole options object will be overridden, so ensure that all parameters are present
385+
* Update details for a specific <a href="https://auth0.com/docs/authenticate/identity-providers">connection</a>, including option properties for identity provider configuration.
384386
*
387+
* <b>Note</b>: If you use the <code>options</code> parameter, the entire <code>options</code> object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.
385388
* Update a connection
386389
*
387390
* @throws {RequiredError}

src/management/__generated/models/index.ts

Lines changed: 136 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,6 +3003,11 @@ export interface Connection {
30033003
*
30043004
*/
30053005
is_domain_connection: boolean;
3006+
/**
3007+
* Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.
3008+
*
3009+
*/
3010+
show_as_button: boolean;
30063011
/**
30073012
* Metadata associated with the connection in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
30083013
*
@@ -3039,6 +3044,11 @@ export interface ConnectionCreate {
30393044
/**
30403045
*/
30413046
is_domain_connection?: boolean;
3047+
/**
3048+
* Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)
3049+
*
3050+
*/
3051+
show_as_button?: boolean;
30423052
/**
30433053
* Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
30443054
*
@@ -3405,6 +3415,56 @@ export interface ConnectionCreateOptionsValidationUsername {
34053415
*/
34063416
max: number;
34073417
}
3418+
/**
3419+
*
3420+
*/
3421+
export interface ConnectionForList {
3422+
/**
3423+
* The name of the connection
3424+
*
3425+
*/
3426+
name?: string;
3427+
/**
3428+
* Connection name used in login screen
3429+
*
3430+
*/
3431+
display_name?: string;
3432+
/**
3433+
* In order to return options in the response, the `read:connections_options` scope must be present
3434+
*
3435+
*/
3436+
options?: { [key: string]: any };
3437+
/**
3438+
* The connection's identifier
3439+
*
3440+
*/
3441+
id?: string;
3442+
/**
3443+
* The type of the connection, related to the identity provider
3444+
*
3445+
*/
3446+
strategy?: string;
3447+
/**
3448+
* Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
3449+
*
3450+
*/
3451+
realms?: Array<string>;
3452+
/**
3453+
* True if the connection is domain level
3454+
*
3455+
*/
3456+
is_domain_connection?: boolean;
3457+
/**
3458+
* Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.
3459+
*
3460+
*/
3461+
show_as_button?: boolean;
3462+
/**
3463+
* Metadata associated with the connection in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
3464+
*
3465+
*/
3466+
metadata?: { [key: string]: any };
3467+
}
34083468
/**
34093469
*
34103470
*/
@@ -3430,6 +3490,11 @@ export interface ConnectionUpdate {
34303490
*
34313491
*/
34323492
realms?: Array<string>;
3493+
/**
3494+
* Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)
3495+
*
3496+
*/
3497+
show_as_button?: boolean;
34333498
/**
34343499
* Metadata associated with the connection in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
34353500
*
@@ -5325,7 +5390,7 @@ export interface GetClients200ResponseOneOf1 {
53255390
/**
53265391
*
53275392
*/
5328-
export type GetConnections200Response = Array<Connection> | GetConnections200ResponseOneOf;
5393+
export type GetConnections200Response = Array<ConnectionForList> | GetConnections200ResponseOneOf;
53295394
/**
53305395
*
53315396
*/
@@ -5341,7 +5406,7 @@ export interface GetConnections200ResponseOneOf {
53415406
total: number;
53425407
/**
53435408
*/
5344-
connections: Array<Connection>;
5409+
connections: Array<ConnectionForList>;
53455410
}
53465411
/**
53475412
*
@@ -14230,6 +14295,9 @@ export interface PostSsoTicketRequest {
1423014295
*
1423114296
*/
1423214297
ttl_sec?: number;
14298+
/**
14299+
*/
14300+
domain_aliases_config?: PostSsoTicketRequestDomainAliasesConfig;
1423314301
}
1423414302
/**
1423514303
* If provided, this will create a new connection for the SSO flow with the given configuration
@@ -14246,8 +14314,15 @@ export interface PostSsoTicketRequestConnectionConfig {
1424614314
*/
1424714315
display_name?: string;
1424814316
/**
14317+
* <code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)
14318+
*
1424914319
*/
1425014320
is_domain_connection?: boolean;
14321+
/**
14322+
* Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to <code>false</code>.)
14323+
*
14324+
*/
14325+
show_as_button?: boolean;
1425114326
/**
1425214327
* Metadata associated with the connection in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
1425314328
*
@@ -14271,13 +14346,69 @@ export interface PostSsoTicketRequestConnectionConfigOptions {
1427114346
*
1427214347
*/
1427314348
domain_aliases?: Array<string>;
14349+
/**
14350+
*/
14351+
idpinitiated?: PostSsoTicketRequestConnectionConfigOptionsIdpinitiated | null;
14352+
}
14353+
/**
14354+
* Allows IdP-initiated login
14355+
*/
14356+
export interface PostSsoTicketRequestConnectionConfigOptionsIdpinitiated {
14357+
/**
14358+
* Enables IdP-initiated login for this connection
14359+
*
14360+
*/
14361+
enabled?: boolean;
14362+
/**
14363+
* Default application <code>client_id</code> user is redirected to after validated SAML response
14364+
*
14365+
*/
14366+
client_id?: string;
14367+
/**
14368+
* The protocol used to connect to the the default application
14369+
*
14370+
*/
14371+
client_protocol?: PostSsoTicketRequestConnectionConfigOptionsIdpinitiatedClientProtocolEnum;
14372+
/**
14373+
* Query string options to customize the behaviour for OpenID Connect when <code>idpinitiated.client_protocol</code> is <code>oauth2</code>. Allowed parameters: <code>redirect_uri</code>, <code>scope</code>, <code>response_type</code>. For example, <code>redirect_uri=https://jwt.io&scope=openid email&response_type=token</code>
14374+
*
14375+
*/
14376+
client_authorizequery?: string;
1427414377
}
14378+
14379+
export const PostSsoTicketRequestConnectionConfigOptionsIdpinitiatedClientProtocolEnum = {
14380+
samlp: 'samlp',
14381+
wsfed: 'wsfed',
14382+
oauth2: 'oauth2',
14383+
} as const;
14384+
export type PostSsoTicketRequestConnectionConfigOptionsIdpinitiatedClientProtocolEnum =
14385+
(typeof PostSsoTicketRequestConnectionConfigOptionsIdpinitiatedClientProtocolEnum)[keyof typeof PostSsoTicketRequestConnectionConfigOptionsIdpinitiatedClientProtocolEnum];
14386+
14387+
/**
14388+
* Configuration for the setup of the connection’s domain_aliases in the self-service SSO flow.
14389+
*/
14390+
export interface PostSsoTicketRequestDomainAliasesConfig {
14391+
/**
14392+
* Whether the end user should complete the domain verification step. Possible values are 'none' (the step is not shown to the user), 'optional' (the user may add a domain alias in the domain verification step) or 'required' (the user must add a domain alias in order to enable the connection). Defaults to 'none'.
14393+
*
14394+
*/
14395+
domain_verification: PostSsoTicketRequestDomainAliasesConfigDomainVerificationEnum;
14396+
}
14397+
14398+
export const PostSsoTicketRequestDomainAliasesConfigDomainVerificationEnum = {
14399+
none: 'none',
14400+
optional: 'optional',
14401+
required: 'required',
14402+
} as const;
14403+
export type PostSsoTicketRequestDomainAliasesConfigDomainVerificationEnum =
14404+
(typeof PostSsoTicketRequestDomainAliasesConfigDomainVerificationEnum)[keyof typeof PostSsoTicketRequestDomainAliasesConfigDomainVerificationEnum];
14405+
1427514406
/**
1427614407
*
1427714408
*/
1427814409
export interface PostSsoTicketRequestEnabledOrganizationsInner {
1427914410
/**
14280-
* Organization identifier
14411+
* Organization identifier.
1428114412
*
1428214413
*/
1428314414
organization_id: string;
@@ -17861,7 +17992,7 @@ export type GetConnectionsStrategyEnum =
1786117992
*/
1786217993
export interface GetConnectionsRequest {
1786317994
/**
17864-
* The amount of entries per page. Default: no paging is used, all connections are returned
17995+
* The amount of entries per page. Defaults to 100 if not provided
1786517996
*
1786617997
*/
1786717998
per_page?: number;
@@ -17971,7 +18102,7 @@ export interface GetStatusRequest {
1797118102
*/
1797218103
export interface PatchConnectionsByIdRequest {
1797318104
/**
17974-
* The id of the connection to retrieve
18105+
* The id of the connection to update
1797518106
*
1797618107
*/
1797718108
id: string;

test/management/connections.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ describe('ConnectionsManager', () => {
9898
expect(connections.data[0].realms?.[0]).toBe(response[0].realms[0]);
9999
expect(connections.data[0].is_domain_connection).toBe(response[0].is_domain_connection);
100100
expect(connections.data[0].metadata?.test).toBe(response[0].metadata.test);
101-
expect(connections.data[0].enabled_clients[0]).toBe(response[0].enabled_clients[0]);
102-
103101
done();
104102
});
105103
});

0 commit comments

Comments
 (0)