MCPcopy
hub / github.com/encode/django-rest-framework / _authenticate

Method _authenticate

rest_framework/request.py:378–395  ·  view source on GitHub ↗

Attempt to authenticate the request using each authentication instance in turn.

(self)

Source from the content-addressed store, hash-verified

376 return (parsed, empty_files)
377
378 def _authenticate(self):
379 """
380 Attempt to authenticate the request using each authentication instance
381 in turn.
382 """
383 for authenticator in self.authenticators:
384 try:
385 user_auth_tuple = authenticator.authenticate(self)
386 except exceptions.APIException:
387 self._not_authenticated()
388 raise
389
390 if user_auth_tuple is not None:
391 self._authenticator = authenticator
392 self.user, self.auth = user_auth_tuple
393 return
394
395 self._not_authenticated()
396
397 def _not_authenticated(self):
398 """

Callers 3

userMethod · 0.95
authMethod · 0.95

Calls 2

_not_authenticatedMethod · 0.95
authenticateMethod · 0.45

Tested by

no test coverage detected