Why must I store a password column in my User domain if I'm using LDAP authentication?

205 Views Asked by At

I have a Grails application that uses the Spring Security Core and Spring Security LDAP plugins. I am using the bind method of authentication with an LDAP server as my only authentication provider. Why must I still store a password column in my database? My application has absolutely no need to store a value for a password, but it will not work if I remove the password field from the generated User domain class. Do I really have to store a password column with the value of null in my User table? Surely there must be a different approach to this.

1

There are 1 best solutions below

1
On BEST ANSWER

I don't think you must!

simply define the password field as transient in your UserAccount class:

class UserAccount {
  String password
  static transients = [ 'password' ]
}