[MAGNOLIA-1566] Expose login failed attribute to form pages Created: 31/May/07  Updated: 23/Jan/13  Resolved: 13/Jun/07

Status: Closed
Project: Magnolia
Component/s: security
Affects Version/s: None
Fix Version/s: 3.1 M2

Type: Improvement Priority: Major
Reporter: zam6ak Assignee: Sameer Charles
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

3.1-SNAPSHOT
JBoss 4.0.5


Issue Links:
relation
is related to MAGNOLIA-3104 Feedback for authorization failures Closed
supersession
is superseded by MAGNOLIA-1591 give access to HttpServletRequest fro... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Since FormClientCallback does not put mgnlLoginError request attribute into Freemarker data model one cannot "capture" such attribute and display error message to the user when login fails on Form based authentication.

Further investigation shows that this would not be possible since base interface does not expose request object (only response is available) so options are:

1. use 401 error page (this did not work even as I declared a simple html 401 page)
2. expose request in base interface and abstract class and then in FormClientCallback grab the mgnlLoginError if set and put it into freemarker data set (hash map)
3. expose request object in every freemarker call (just like contextPath is exposed, if request is exposed contextPath can be ommited actually...) (see FreemarkerHelper.render)



 Comments   
Comment by Sameer Charles [ 13/Jun/07 ]

Fixed:

Basic FormClientCallback sets login error on failed login which is passed as a map to freemarker template.
You can override FormClientCallback.getMessages(HttpServletRequest request) to extend/change this behaviour.

Generated at Mon Feb 12 03:28:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.