You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/09/24 16:31:00 UTC

[jira] [Commented] (AIRAVATA-3361) MultiValueDictKeyError at /auth/handle_login "'username'"

    [ https://issues.apache.org/jira/browse/AIRAVATA-3361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17201635#comment-17201635 ] 

ASF subversion and git services commented on AIRAVATA-3361:
-----------------------------------------------------------

Commit 3836bcd1031d27160ffd06cc2a68305b5759fd17 in airavata-django-portal's branch refs/heads/develop from Marcus Christie
[ https://gitbox.apache.org/repos/asf?p=airavata-django-portal.git;h=3836bcd ]

AIRAVATA-3361 Redirect handle_login to login page

Fixes an error that is generated when clients make a GET request to /auth/handle_login, which assumes that the request is a POST request with username
and password. Now, if a GET request, a redirect to /auth/login is returned.


>  MultiValueDictKeyError at /auth/handle_login "'username'"
> ----------------------------------------------------------
>
>                 Key: AIRAVATA-3361
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3361
>             Project: Airavata
>          Issue Type: Bug
>          Components: Django Portal
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
>
> This error occurs when a user loads the /auth/handle_login as a GET request. /auth/handle_login incorrectly assumes that it will only handle POST requests.
> I think the solution is to just have {{GET /auth/handle_login}} redirect to {{GET /auth/login}}.
> {code}
>  Traceback: 
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/utils/datastructures.py" in __getitem__
>   83.             list_ = super(MultiValueDict, self).__getitem__(key)
>  
>    
>       During handling of the above exception ('username'), another exception occurred:
>    
>  
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py" in inner
>   41.             response = get_response(request)
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" in _get_response
>   187.                 response = self.process_exception_by_middleware(e, request)
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/core/handlers/base.py" in _get_response
>   185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/views/decorators/debug.py" in sensitive_variables_wrapper
>   36.             return func(*func_args, **func_kwargs)
> File "/var/www/portals/django-interactwel/airavata-django-portal/django_airavata/apps/auth/views.py" in handle_login
>   81.     username = request.POST['username']
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/utils/datastructures.py" in __getitem__
>   85.             raise MultiValueDictKeyError(repr(key))
> Exception Type: MultiValueDictKeyError at /auth/handle_login
> Exception Value: "'username'"
> {code}
> Also I'll note that it seems many if not most of these errors are actually coming from search engine bots.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)