diff --git a/test/cypress/config/ci.js b/test/cypress/config/ci.js index 5f413cf3..ae943127 100644 --- a/test/cypress/config/ci.js +++ b/test/cypress/config/ci.js @@ -16,6 +16,9 @@ module.exports = defineConfig({ }, env: { swaggerBase: '{{baseUrl}}/api/schema', + authentik: 'http://authentik:9000', + authentikLdap: 'authentik-ldap:3389', + oauthRedirect: 'http://fullstack:81', }, baseUrl: 'http://localhost:1234', }, diff --git a/test/cypress/config/dev.js b/test/cypress/config/dev.js index bd362241..d311fd31 100644 --- a/test/cypress/config/dev.js +++ b/test/cypress/config/dev.js @@ -15,6 +15,9 @@ module.exports = defineConfig({ }, env: { swaggerBase: '{{baseUrl}}/api/schema', + authentik: 'http://authentik:9000', + authentikLdap: 'authentik-ldap:3389', + oauthRedirect: 'http://npm:81', }, } }); diff --git a/test/cypress/e2e/api/Ldap.cy.js b/test/cypress/e2e/api/Ldap.cy.js index afc86896..37d655e9 100644 --- a/test/cypress/e2e/api/Ldap.cy.js +++ b/test/cypress/e2e/api/Ldap.cy.js @@ -14,7 +14,7 @@ describe('LDAP with Authentik', () => { path: '/api/settings/ldap-auth', data: { value: { - host: 'authentik-ldap:3389', + host: Cypress.env('authentik-ldap'), base_dn: 'ou=users,DC=ldap,DC=goauthentik,DC=io', user_dn: 'cn={{USERNAME}},ou=users,DC=ldap,DC=goauthentik,DC=io', email_property: 'mail', diff --git a/test/cypress/e2e/api/OAuth.cy.js b/test/cypress/e2e/api/OAuth.cy.js index 7bb5d552..b2751089 100644 --- a/test/cypress/e2e/api/OAuth.cy.js +++ b/test/cypress/e2e/api/OAuth.cy.js @@ -16,10 +16,10 @@ describe('OAuth with Authentik', () => { value: { client_id: 'U5gCy0ymU8OofWS4nmkAPugCbWkFkkPztap38ReD', client_secret: '9ZFClxwp7LzbfhIDk7k9DngQNQfwDAYqPrQMGXjFumCvQZATtXCwme20o0TnLP6uEHUkKqEFOInhxp01gVeaHCLW83iTK4PonoUnpFnXgyZAcu0H3zBxxOkVtRwACaoW', - authorization_url: 'http://authentik-ldap:9000/application/o/authorize/', - resource_url: 'http://authentik-ldap:9000/application/o/userinfo/', - token_url: 'http://authentik-ldap:9000/application/o/token/', - logout_url: 'http://authentik-ldap:9000/application/o/npm3/end-session/', + authorization_url: Cypress.env('authentik') + '/application/o/authorize/', + resource_url: Cypress.env('authentik') + '/application/o/userinfo/', + token_url: Cypress.env('authentik') + '/application/o/token/', + logout_url: Cypress.env('authentik') + '/application/o/npm3/end-session/', identifier: 'preferred_username', scopes: [], auto_create_user: true @@ -51,7 +51,7 @@ describe('OAuth with Authentik', () => { it('Should log in with OAuth', function() { cy.task('backendApiGet', { token: token, - path: '/oauth/login?redirect_base=http%3A%2F%2Ffullstack%3A81', + path: '/oauth/login?redirect_base=' + encodeURI(Cypress.env('oauthRedirect')), }).then((data) => { expect(data).to.have.property('result'); cy.visit(data.result);