diff --git a/src/resources/HostedInterfacesCore/HostedInterfaceVersionsCore.ts b/src/resources/HostedInterfacesCore/HostedInterfaceVersionsCore.ts index cdc7462a9..de80450ba 100644 --- a/src/resources/HostedInterfacesCore/HostedInterfaceVersionsCore.ts +++ b/src/resources/HostedInterfacesCore/HostedInterfaceVersionsCore.ts @@ -156,6 +156,11 @@ export interface IAccesses { * @default false */ sharingDomainEnabled?: boolean; + + /** + * The name of the Search API SAML identity provider used to authenticate Search Page viewers. + */ + samlProvider?: string; } export interface ISortCriteria { diff --git a/src/resources/NextGenSearchPages/tests/NextGenSearchPages.spec.ts b/src/resources/NextGenSearchPages/tests/NextGenSearchPages.spec.ts index 9fdc2c94b..73458b985 100644 --- a/src/resources/NextGenSearchPages/tests/NextGenSearchPages.spec.ts +++ b/src/resources/NextGenSearchPages/tests/NextGenSearchPages.spec.ts @@ -81,6 +81,7 @@ describe('NextGenSearchPages', () => { domains: ['domain1', 'domain2'], sharingDomainEnabled: true, sharingLinkEnabled: true, + samlProvider: 'oktaIntegratorDev', }, layout: SearchPageLayout.List, style: { diff --git a/src/resources/Search/Search.ts b/src/resources/Search/Search.ts index 6b11a0398..db852f12c 100644 --- a/src/resources/Search/Search.ts +++ b/src/resources/Search/Search.ts @@ -8,6 +8,7 @@ import { RestQueryParams, RestQueryResult, RestTokenParams, + SearchApiSamlIdentityProvider, SearchListFieldsParams, SearchListFieldsResponse, SearchResponse, @@ -18,11 +19,16 @@ import {ListFieldValuesBodyQueryParams, PostSearchQuerySuggestBodyParams} from ' export default class Search extends Resource { static baseUrl = `/rest/search/v2`; + static authenticationBaseUrl = `/rest/organizations/${API.orgPlaceholder}/authentication`; createToken(tokenParams: RestTokenParams) { return this.api.post(`${Search.baseUrl}/token?organizationId=${API.orgPlaceholder}`, tokenParams); } + listSamlIdentityProviders(): Promise { + return this.api.get(`${Search.authenticationBaseUrl}/saml`); + } + listFields(params?: SearchListFieldsParams) { return this.api.get( this.buildPath( diff --git a/src/resources/Search/SearchInterfaces.ts b/src/resources/Search/SearchInterfaces.ts index fee45cd50..743ee3c02 100644 --- a/src/resources/Search/SearchInterfaces.ts +++ b/src/resources/Search/SearchInterfaces.ts @@ -2781,3 +2781,14 @@ export interface RestFacetSearchResponse { */ moreValuesAvailable: boolean; } + +export interface SearchApiSamlIdentityProvider { + /** + * Unique identifier of the SAML provider. + */ + id: string; + /** + * Unique name of the SAML proivder used to connect via the Search API. + */ + name: string; +} diff --git a/src/resources/Search/test/Search.spec.ts b/src/resources/Search/test/Search.spec.ts index ff486cfbc..22187fc34 100644 --- a/src/resources/Search/test/Search.spec.ts +++ b/src/resources/Search/test/Search.spec.ts @@ -240,4 +240,13 @@ describe('Search', () => { Object.defineProperty(api, 'organizationId', {value: tempOrganizationId, writable: true}); }); }); + + describe('listSamlIdentityProviders', () => { + it('should make a GET call to the Search API SAML providers endpoint', async () => { + await search.listSamlIdentityProviders(); + + expect(api.get).toHaveBeenCalledTimes(1); + expect(api.get).toHaveBeenCalledWith('/rest/organizations/{organizationName}/authentication/saml'); + }); + }); });