-
-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): implement get sso connectors
implement get sso connectors endpoint
- Loading branch information
Showing
4 changed files
with
106 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,4 +198,50 @@ devFeatureTest.describe('enterprise sso verification', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('getSsoConnectorsByEmail', () => { | ||
const ssoConnectorApi = new SsoConnectorApi(); | ||
const domain = `foo${randomString()}.com`; | ||
|
||
beforeAll(async () => { | ||
await ssoConnectorApi.createMockOidcConnector([domain]); | ||
|
||
await updateSignInExperience({ | ||
singleSignOnEnabled: true, | ||
}); | ||
}); | ||
|
||
afterAll(async () => { | ||
await ssoConnectorApi.cleanUp(); | ||
}); | ||
|
||
it('should get sso connectors with given email properly', async () => { | ||
const client = await initExperienceClient(); | ||
|
||
const response = await client.getAvailableSsoConnectors('bar@' + domain); | ||
|
||
expect(response.connectorIds.length).toBeGreaterThan(0); | ||
expect(response.connectorIds[0]).toBe(ssoConnectorApi.firstConnectorId); | ||
}); | ||
|
||
it('should return empty array if no sso connectors found', async () => { | ||
const client = await initExperienceClient(); | ||
|
||
const response = await client.getAvailableSsoConnectors('[email protected]'); | ||
|
||
expect(response.connectorIds.length).toBe(0); | ||
}); | ||
|
||
it('should return empty array if sso is not enabled', async () => { | ||
await updateSignInExperience({ | ||
singleSignOnEnabled: false, | ||
}); | ||
|
||
const client = await initExperienceClient(); | ||
|
||
const response = await client.getAvailableSsoConnectors('bar@' + domain); | ||
|
||
expect(response.connectorIds.length).toBe(0); | ||
}); | ||
}); | ||
}); |