MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / authenticate

Method authenticate

web/pgadmin/authenticate/__init__.py:286–308  ·  view source on GitHub ↗

Authenticate through all the sources.

(self)

Source from the content-addressed store, hash-verified

284 return False
285
286 def authenticate(self):
287 """Authenticate through all the sources."""
288 status = False
289 msg = None
290 for src in self.auth_sources:
291 source = get_auth_sources(src)
292 self.set_source(source)
293 current_app.logger.debug(
294 "Authentication initiated via source: %s" %
295 source.get_source_name())
296
297 status, msg = source.authenticate(self.form)
298
299 if status:
300 self.set_current_source(source.get_source_name())
301 if msg is not None and 'username' in msg:
302 self.form._fields['email'].data = msg['username']
303 return status, msg
304 else:
305 current_app.logger.debug(
306 "Authentication initiated via source: %s is failed." %
307 source.get_source_name())
308 return status, msg
309
310 def login(self):
311 status, msg = self.source.login(self.form)

Callers 1

_loginFunction · 0.95

Calls 4

set_sourceMethod · 0.95
set_current_sourceMethod · 0.95
get_auth_sourcesFunction · 0.85
get_source_nameMethod · 0.45

Tested by

no test coverage detected