Submit form data to /j_spring_security_check

207 views
Skip to first unread message

Dave

unread,
Mar 22, 2016, 6:04:14 AM3/22/16
to Hippo Community
Hi,

I am trying to use spring security with my Hippo project. Here's my form looks like

<@hst.link var="myaccountLink" siteMapItemRefId="profile" fullyQualified="true" />
 <@hst.link var="loginLink" path="/login/j_spring_security_check"/>
        <form id="loginFormID" action="${loginLink}?spring-security-redirect=${myaccountLink}" method="post">
                <input type="text" placeholder="YOUR EMAIL ADDRESS">
                <input type="text" placeholder="YOUR PASSWORD">
                <button type="button">GO</button>
         </form>

When i type /login/j_spring_security_check on the address bar it works (it says authentication failed since i am not sending any post requests) but this form doesn't do anything.

This is the stack trace:

[INFO] [talledLocalContainer] FTL stack trace ("~" means nesting-related):

[INFO] [talledLocalContainer] - Failed at: ${myaccountLink}  [in template "webfile:/freemarker/myhippoproject/base-top-menu.ftl" at line 68, column 102]

[INFO] [talledLocalContainer] ----. To see the stack trace, set 'org.hippoecm.hst.servlet.HstFreemarkerServlet' log-level to debug in log4j configuration or runtime via the logging servlet

Anybody have any idea to get this work?

I am using Hippo Community edition 10.2

Thanks,

Mahesh Acharya

unread,
Mar 22, 2016, 6:26:05 AM3/22/16
to hippo-c...@googlegroups.com

Hi Dave

Is the CSRF enabled? 
If yes, are you including CSRF tokens (see below) in the form? 

<#if _csrf??>
<input type="hidden" name="${_csrf.parameterName}"  value="${_csrf.token}"/>
</#if>


Best
Mahesh

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Mahesh R. ACHARYA
Solution Architect | Mobile: 781-640-5559 | Email: m.ac...@onehippo.com
Boston -  71 Summer Street, Boston, MA 02110
Amsterdam - Oosteinde 11, 1017 WT Amsterdam

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
http://www.onehippo.com/
Reply all
Reply to author
Forward
0 new messages