Ldap.cy.js 1.8 KB

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