|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
How to log in when using acegi plugin?Here is my login form:
<form action='/myapp/login' method='POST' id='loginForm1' name='loginForm' class='cssform'> <div class="login_right"> <ul> <li><input name="j_username" id="j_username" type="text" class="loginbg"/></li> <li><input name="j_password" type="password" id="j_password" type="text" class="loginbg"/> I submit this form by javascript: document.loginForm.submit(); In LoginController: def index = { println "bbbbbbbbbbbbbbbb" if (isLoggedIn()) { redirect uri: '/user/userInfo' } else { redirect action: auth, params: params } } But I can't see "bbbbbbbbbbbbbbbb" in console. My browser suspend after submitting. I tried using <form action='myapp/j_spring_security_check'... but it didn't work properly. Thanks |
|
|
Re: How to log in when using acegi plugin?Antoine tomLee a écrit :
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
|
|
|
Re: How to log in when using acegi plugin?This is already a part of the plugin, see auth.gsp. You need to post to j_spring_security_check so the appropriate filter intercepts the submission and does the authentication. Your login controller is just a helper, called after a successful or unsuccessful login.
Note that you need to use "action='/myapp/j_spring_security_check'" with a leading slash to make the URI absolute or do what the plugin code does: <form action='${request.contextPath}/j_spring_security_check' method='POST' id='loginForm' class='cssform'> This is different from what's in auth.gsp since the plugin also supports OpenID and Facebook logins, but the previous line is what would be used with regular logins. There's a writeup on using Ajax logins here: http://www.grails.org/AcegiSecurity+Plugin+-+Ajax+Authentication Burt > > Here is my login form: > <form action='/myapp/login' method='POST' id='loginForm1' name='loginForm' > class='cssform'> > <div class="login_right"> > <ul> > <li><input name="j_username" id="j_username" type="text" > class="loginbg"/></li> > <li><input name="j_password" type="password" > id="j_password" type="text" class="loginbg"/> > > I submit this form by javascript: > document.loginForm.submit(); > > In LoginController: > def index = { > println "bbbbbbbbbbbbbbbb" > if (isLoggedIn()) { > redirect uri: '/user/userInfo' > } > else { > redirect action: auth, params: params > } > } > > But I can't see "bbbbbbbbbbbbbbbb" in console. My browser suspend after > submitting. > > I tried using <form action='myapp/j_spring_security_check'... > but it didn't work properly. > > Thanks > |
|
|
Re: How to log in when using acegi plugin?I have tried j_spring_security_check,but this seems a ajax login,after logged in,the page is stall the same page,not redirect to the page I want, I added redirect in logincontroller, but not working.
|
|
|
Re: How to log in when using acegi plugin?Yes, I am sure it submitted.
|
| Free embeddable forum powered by Nabble | Forum Help |