I used rubycas-server to build an sso systems, using devise to do the user's system, but now my question is, rubycas-server only one field like 'email' , I want to use 'email' / 'tel' / 'nickname' for user login. no more info in wiki
authenticator:
class: CASServer::Authenticators::SQLBcrypt
database:
adapter: mysql2
database: xxxx
username: root
password: xxxx
host: localhost
user_table: users
username_column: email # tel/nickname
password_column: encrypted_password
sorry about my poor English! help me, thanks very much!
I'm affraid it woulnd't be possible. As can be seen in the official repository, this authenticator just matches given column name with user name:
def matching_users
results = user_model.find(:all, :conditions => ["#{username_column} = ?", @username])
results.select { |user| BCrypt::Password.new(user.send(password_column.to_sym)) == @password }
end
For your case the best idea would be to write custom authenticator that matches email/tel/nickname. This is however very tough login name though, consider some more user friendly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With