Ldap.cy.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /// <reference types="cypress" />
  2. describe('LDAP with Authentik', () => {
  3. let token;
  4. if (Cypress.env('skipStackCheck') === 'true' || Cypress.env('stack') === 'postgres') {
  5. before(() => {
  6. cy.getToken().then((tok) => {
  7. token = tok;
  8. // cy.task('backendApiPut', {
  9. // token: token,
  10. // path: '/api/settings/ldap-auth',
  11. // data: {
  12. // value: {
  13. // host: 'authentik-ldap:3389',
  14. // base_dn: 'ou=users,DC=ldap,DC=goauthentik,DC=io',
  15. // user_dn: 'cn={{USERNAME}},ou=users,DC=ldap,DC=goauthentik,DC=io',
  16. // email_property: 'mail',
  17. // name_property: 'sn',
  18. // self_filter: '(&(cn={{USERNAME}})(ak-active=TRUE))',
  19. // auto_create_user: true
  20. // }
  21. // }
  22. // }).then((data) => {
  23. // cy.validateSwaggerSchema('put', 200, '/settings/{name}', data);
  24. // expect(data.result).to.have.property('id');
  25. // expect(data.result.id).to.be.greaterThan(0);
  26. // });
  27. // cy.task('backendApiPut', {
  28. // token: token,
  29. // path: '/api/settings/auth-methods',
  30. // data: {
  31. // value: [
  32. // 'local',
  33. // 'ldap'
  34. // ]
  35. // }
  36. // }).then((data) => {
  37. // cy.validateSwaggerSchema('put', 200, '/settings/{name}', data);
  38. // expect(data.result).to.have.property('id');
  39. // expect(data.result.id).to.be.greaterThan(0);
  40. // });
  41. });
  42. });
  43. it.skip('Should log in with LDAP', function() {
  44. // cy.task('backendApiPost', {
  45. // token: token,
  46. // path: '/api/auth',
  47. // data: {
  48. // // Authentik LDAP creds:
  49. // type: 'ldap',
  50. // identity: 'cypress',
  51. // secret: 'fqXBfUYqHvYqiwBHWW7f'
  52. // }
  53. // }).then((data) => {
  54. // cy.validateSwaggerSchema('post', 200, '/auth', data);
  55. // expect(data.result).to.have.property('token');
  56. // });
  57. });
  58. }
  59. });