views:

125

answers:

1

Hi all

Is it possible, using spring security plugin 0.5.3 with Grails 1.2.1, to authenticate a user using only one field? I mean, for example, making j_username and j_password fields in the authentication form equal previous to the authentication. I read it was possible to define j_username field in Config.groovy with acegi plugin, in older versions of the plugin. Now it uses SecurityConfig.groovy but the possibility of defining the field exists no more.

Any ideas??

Thanks a lot,

Miguel

A: 

You could make the j_password field hidden and then when you render the login page you can populate the hidden field with a hard coded password that is common to all users.

<g:hiddenField value="${passwordVal}" name='j_password' id='j_password' />

Then when you login the hidden field is submitted.

Its not perfect, but should work for your needs.

tinny
Yeah, it fits my needs; however, I think I'll end using two fields with the same code, like a confirmation. Thanks a lot!
Miguel