As a fallout from #10890 we should think about what status codes we want to display when a user cannot login to the system. Currently we return a 200 in all cases. We probably want to consider a 403 and also changing the status codes in these exceptions https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/cms.php#L889-L896 to actually be something that makes sense and then use them.
Labels |
Added:
?
|
Category | ⇒ | com_users |
Status | New | ⇒ | Needs Review |
Status | Needs Review | ⇒ | Information Required |
I don't have the time to properly work my way through this right now - so not right now please. Assuming Brian is right about the 401 then this requires changes and so is an open issue (because iirc at the moment everything gives 200's)
"assuming brian is right"? I just quote the internet standards
I'm not convinced 401 is correct. What would you pass as WWW-Authenticate header then?
Stackoverflow often says 400 or 403. Or just 200 like we do currently because because from a protocol/server view the request still was successful.
I would rather follow the official standards than a comment on stack overflow ;)
The status code is built for the HTTP authentication methods (basic, digest, ...) and thus the official standard mandates that you MUST send a WWW-Authenticate header in the response so the browser knows what to do.
It's not a real fit for CMS authentications as we don't do it on a protocol level.
Status | Information Required | ⇒ | Discussion |
Labels |
Added:
?
Removed: J3 Issue |
So I just spent some time looking to see what others do. I can see that w and d have regularly had this same discussion over the years. Someone who did even more research on this @johnbillion and say that 200 is correct - so no change https://core.trac.wordpress.org/ticket/25446#comment:29
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-11-12 08:48:09 |
Closed_By | ⇒ | joomdonation | |
Labels |
Added:
?
No Code Attached Yet
Removed: ? ? |
Base on research from @brianteeman, return 200 for http code is OK (see comment above), so I'm closing this issue. Feel free to re-open if needed.
New reference is
joomla-cms/libraries/src/Application/CMSApplication.php
Line 892 in 7ab744f