fleet/cypress/integration/premium/sso.spec.ts
Roberto Dip 5371e9c927
add UI and documentation for JIT provisioning (#7189)
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.
2022-08-15 15:26:55 -03:00

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");
});
});
});