mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
5371e9c927
Related to #7054 and #6834, this adds the UI changes necessary to support JIT provisioning: A checkbox in the settings page A new template for the activity box This also includes relevant documentation about the feature and how to configure it.
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
describe("SSO Sessions", () => {
|
|
describe("JIT user provisioning", () => {
|
|
before(() => {
|
|
cy.setup();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
Cypress.session.clearAllSavedSessions();
|
|
});
|
|
|
|
it("non-existent users can't login if JIT is not enabled", () => {
|
|
cy.login();
|
|
cy.setupSSO({
|
|
enable_sso_idp_login: true,
|
|
enable_jit_provisioning: false,
|
|
});
|
|
cy.logout();
|
|
cy.visit("/");
|
|
// Log in
|
|
cy.contains("button", "Sign on with SimpleSAML");
|
|
cy.loginSSO({ username: "sso_user2" });
|
|
cy.url().should("include", "/login?status=account_invalid");
|
|
cy.getAttached(".flash-message");
|
|
});
|
|
|
|
it("non-existent users are provisioned if JIT is enabled", () => {
|
|
cy.login();
|
|
cy.setupSSO({
|
|
enable_sso_idp_login: true,
|
|
enable_jit_provisioning: true,
|
|
});
|
|
cy.logout();
|
|
cy.visit("/");
|
|
// Log in
|
|
cy.contains("button", "Sign on with SimpleSAML");
|
|
cy.loginSSO({ username: "sso_user2" });
|
|
cy.contains("Hosts");
|
|
cy.contains("was added to Fleet by SSO");
|
|
});
|
|
|
|
it("existing users can log-in normally with JIT enabled", () => {
|
|
cy.login();
|
|
cy.setupSSO({
|
|
enable_sso_idp_login: true,
|
|
enable_jit_provisioning: true,
|
|
});
|
|
cy.logout();
|
|
cy.visit("/");
|
|
// Log in
|
|
cy.contains("button", "Sign on with SimpleSAML");
|
|
cy.loginSSO({ username: "sso_user" });
|
|
cy.contains("Hosts");
|
|
});
|
|
});
|
|
});
|