You've already forked nginx-proxy-manager
							
							
				mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-10-30 18:05:34 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /// <reference types="cypress" />
 | |
| 
 | |
| describe('LDAP with Authentik', () => {
 | |
| 	let _token;
 | |
| 	if (Cypress.env('skipStackCheck') === 'true' || Cypress.env('stack') === 'postgres') {
 | |
| 
 | |
| 		before(() => {
 | |
| 			cy.resetUsers();
 | |
| 			cy.getToken().then((tok) => {
 | |
| 				_token = tok;
 | |
| 
 | |
| 				// cy.task('backendApiPut', {
 | |
| 				// 	token: token,
 | |
| 				// 	path:  '/api/settings/ldap-auth',
 | |
| 				// 	data:  {
 | |
| 				// 		value: {
 | |
| 				// 			host: 'authentik-ldap:3389',
 | |
| 				// 			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',
 | |
| 				// 			name_property: 'sn',
 | |
| 				// 			self_filter: '(&(cn={{USERNAME}})(ak-active=TRUE))',
 | |
| 				// 			auto_create_user: true
 | |
| 				// 		}
 | |
| 				// 	}
 | |
| 				// }).then((data) => {
 | |
| 				// 	cy.validateSwaggerSchema('put', 200, '/settings/{name}', data);
 | |
| 				// 	expect(data.result).to.have.property('id');
 | |
| 				// 	expect(data.result.id).to.be.greaterThan(0);
 | |
| 				// });
 | |
| 
 | |
| 				// cy.task('backendApiPut', {
 | |
| 				// 	token: token,
 | |
| 				// 	path:  '/api/settings/auth-methods',
 | |
| 				// 	data:  {
 | |
| 				// 		value: [
 | |
| 				// 			'local',
 | |
| 				// 			'ldap'
 | |
| 				// 		]
 | |
| 				// 	}
 | |
| 				// }).then((data) => {
 | |
| 				// 	cy.validateSwaggerSchema('put', 200, '/settings/{name}', data);
 | |
| 				// 	expect(data.result).to.have.property('id');
 | |
| 				// 	expect(data.result.id).to.be.greaterThan(0);
 | |
| 				// });
 | |
| 			});
 | |
| 		});
 | |
| 
 | |
| 		it.skip('Should log in with LDAP', () => {
 | |
| 			// cy.task('backendApiPost', {
 | |
| 			// 	token: token,
 | |
| 			// 	path:  '/api/auth',
 | |
| 			// 	data:  {
 | |
| 			// 		// Authentik LDAP creds:
 | |
| 			// 		type: 'ldap',
 | |
| 			// 		identity: 'cypress',
 | |
| 			// 		secret: 'fqXBfUYqHvYqiwBHWW7f'
 | |
| 			// 	}
 | |
| 			// }).then((data) => {
 | |
| 			// 	cy.validateSwaggerSchema('post', 200, '/auth', data);
 | |
| 			// 	expect(data.result).to.have.property('token');
 | |
| 			// });
 | |
| 		});
 | |
| 	}
 | |
| });
 |