Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad credential not correctly handled #1

Closed
antonincms opened this issue Nov 20, 2018 · 0 comments
Closed

Bad credential not correctly handled #1

antonincms opened this issue Nov 20, 2018 · 0 comments
Labels
auth-backend bug Something isn't working

Comments

@antonincms
Copy link
Member

antonincms commented Nov 20, 2018

When I tried to login with an inexistent user / password, I got :

Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/srv/langate2000/langate/langate/insalan_auth/insalan_backend.py", line 38, in authenticate
    user = UserModel._default_manager.get_by_natural_key(username)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 44, in get_by_natural_key
    return self.get(**{self.model.USERNAME_FIELD: username})
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/db/models/query.py", line 399, in get
    self.model._meta.object_name
django.contrib.auth.models.User.DoesNotExist: User matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/contrib/auth/views.py", line 61, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/views/generic/edit.py", line 141, in post
    if form.is_valid():
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/forms/forms.py", line 185, in is_valid
    return self.is_bound and not self.errors
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/forms/forms.py", line 180, in errors
    self.full_clean()
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/forms/forms.py", line 382, in full_clean
    self._clean_form()
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/forms/forms.py", line 409, in _clean_form
    cleaned_data = self.clean()
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/contrib/auth/forms.py", line 196, in clean
    self.user_cache = authenticate(self.request, username=username, password=password)
  File "/srv/langate2000/venv/lib/python3.7/site-packages/django/contrib/auth/__init__.py", line 73, in authenticate
    user = backend.authenticate(request, **credentials)
  File "/srv/langate2000/langate/langate/insalan_auth/insalan_backend.py", line 72, in authenticate
    raise BadCredentialsException
langate.insalan_auth.insalan_backend.BadCredentialsException

Could I have validation of this as a bug ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth-backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants