View | Details | Raw Unified | Return to bug 31861 | Differences between
and this patch

Collapse All | Expand All

(-)univention-management-console/src/univention/management/console/protocol/server.py (-1 / +6 lines)
Lines 213-219 Link Here
213
		elif msg.command == 'AUTH':
213
		elif msg.command == 'AUTH':
214
			state.authResponse = Response( msg )
214
			state.authResponse = Response( msg )
215
			try:
215
			try:
216
				state.authenticate( msg.body[ 'username' ], msg.body[ 'password' ], msg.body.get( 'new_password' ) )
216
				state.authenticate(**dict(auth_type=msg.body.get('auth_type'),
217
				                          username=msg.body['username'],
218
				                          password=msg.body['password'],
219
				                          new_password=msg.body.get('new_password'))
220
				)
217
			except ( TypeError, KeyError ), e:
221
			except ( TypeError, KeyError ), e:
218
				state.authResponse.status = BAD_REQUEST_INVALID_OPTS
222
				state.authResponse.status = BAD_REQUEST_INVALID_OPTS
219
				state.authResponse.message = 'insufficient authentification information'
223
				state.authResponse.message = 'insufficient authentification information'
Lines 500-505 Link Here
500
504
501
	def _connection( self, socket ):
505
	def _connection( self, socket ):
502
		'''Signal callback: Invoked on incoming connections.'''
506
		'''Signal callback: Invoked on incoming connections.'''
507
503
		socket, addr = socket.accept()
508
		socket, addr = socket.accept()
504
		socket.setblocking( 0 )
509
		socket.setblocking( 0 )
505
		if addr:
510
		if addr:
(-)univention-management-console/src/univention/management/console/protocol/client.py (-2 / +3 lines)
Lines 340-351 Link Here
340
		else:
340
		else:
341
			self.signal_emit( 'error', UnknownRequestError() )
341
			self.signal_emit( 'error', UnknownRequestError() )
342
342
343
	def authenticate( self, username, password, new_password=None ):
343
	def authenticate( self, username, password, **kwargs ):
344
		"""Authenticate against the UMC server"""
344
		"""Authenticate against the UMC server"""
345
		authRequest = Request ('AUTH' )
345
		authRequest = Request ('AUTH' )
346
		
347
		authRequest.body.update(kwargs)
346
		authRequest.body['username'] = username
348
		authRequest.body['username'] = username
347
		authRequest.body['password'] = password
349
		authRequest.body['password'] = password
348
		authRequest.body['new_password'] = new_password
349
350
350
		self.request( authRequest )
351
		self.request( authRequest )
351
352
(-)univention-management-console/src/univention/management/console/protocol/session.py (-2 / +2 lines)
Lines 99-108 Link Here
99
	def _authenticated( self, success ):
99
	def _authenticated( self, success ):
100
		self.signal_emit( 'authenticated', success, self )
100
		self.signal_emit( 'authenticated', success, self )
101
101
102
	def authenticate( self, username, password, new_password=None ):
102
	def authenticate( self, username, password, **kwargs  ):
103
		"""Initiates an authentication process"""
103
		"""Initiates an authentication process"""
104
		self.username = username
104
		self.username = username
105
		self.__auth.authenticate( username, password, new_password )
105
		self.__auth.authenticate( username, password, **kwargs )
106
106
107
	def credentials( self ):
107
	def credentials( self ):
108
		"""Returns the credentials"""
108
		"""Returns the credentials"""
(-)univention-management-console/src/univention/management/console/auth.py (-5 / +7 lines)
Lines 247-253 Link Here
247
		self.signal_new( 'authenticated' )
247
		self.signal_new( 'authenticated' )
248
		self.__credentials = None
248
		self.__credentials = None
249
249
250
	def _create_modules( self, username, password ):
250
	def _create_modules( self, username, password, **kwargs ):
251
		global _all_modules
251
		global _all_modules
252
		self._modules = []
252
		self._modules = []
253
		for mod in _all_modules:
253
		for mod in _all_modules:
Lines 256-266 Link Here
256
			instance.signal_connect( 'password_changed', self._password_changed )
256
			instance.signal_connect( 'password_changed', self._password_changed )
257
			self._modules.append( instance )
257
			self._modules.append( instance )
258
		self._modules.reverse()
258
		self._modules.reverse()
259
259
	  
260
	def authenticate( self, username, password, new_password=None ):
260
	def authenticate( self, username, password, **kwargs ):
261
		self._create_modules( username, password )
261
		if kwargs.get('auth_type') == "saml":
262
			AUTH.warn('__starting SAML Authenticate __')
263
		self._create_modules( username, password, **kwargs )
262
		self._current = self._modules.pop()
264
		self._current = self._modules.pop()
263
		self.__new_password = new_password
265
		self.__new_password = kwargs.get('new_password')
264
		self._current.authenticate()
266
		self._current.authenticate()
265
		self.__credentials = ( username, password )
267
		self.__credentials = ( username, password )
266
268
(-)univention-management-console-frontend/univention-management-console-web-server (-5 / +5 lines)
Lines 133-139 Link Here
133
		self._auth_response = umcp.Response( request )
133
		self._auth_response = umcp.Response( request )
134
		self._auth_response.body['sessionid'] = request.body.get('sessionid','')
134
		self._auth_response.body['sessionid'] = request.body.get('sessionid','')
135
		self._auth_response_queue = response_queue
135
		self._auth_response_queue = response_queue
136
		self.client.authenticate( request.body[ 'username' ], request.body[ 'password' ], request.body[ 'new_password' ] )
136
		self.client.authenticate( **request.body )
137
137
138
	def _response(self, response):
138
	def _response(self, response):
139
		"""Queue response from UMC server."""
139
		"""Queue response from UMC server."""
Lines 553-566 Link Here
553
			body = cherrypy.request.body.read()
553
			body = cherrypy.request.body.read()
554
554
555
		json = self.load_json(body)
555
		json = self.load_json(body)
556
557
		CORE.info('CPRoot/command: request: command=%s' % cherrypy.request.path_info )
556
		CORE.info('CPRoot/command: request: command=%s' % cherrypy.request.path_info )
558
557
559
		# create new UMCP request
558
		# create new UMCP request
560
		req = umcp.Request( 'AUTH' )
559
		req = umcp.Request( 'AUTH' )
561
		req.body[ 'username' ] = json[ 'options' ].get('username','')
560
		json['options'].setdefault('password', '')
562
		req.body[ 'password' ] = json[ 'options' ].get('password','')
561
		json['options'].setdefault('username', '')
563
		req.body[ 'new_password' ] = json[ 'options' ].get('new_password')
562
		json['options'].setdefault('new_password', '')
563
		req.body.update(json['options'])
564
564
565
		# create new response queue
565
		# create new response queue
566
		response_queue = Queue.Queue()
566
		response_queue = Queue.Queue()

Return to bug 31861