Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

CASino and redmine_cas authentification #22

Open
b-solution opened this issue Nov 27, 2015 · 2 comments
Open

CASino and redmine_cas authentification #22

b-solution opened this issue Nov 27, 2015 · 2 comments

Comments

@b-solution
Copy link

Hi, thanks for the great work, I installed redmine_cas in my redmine 2.6 and it can redirect me to my CASino server but i wonder how could i populate the CAS server. i want that all users in redmine could have the same login/password in CAS.
Thanks for the help

@sebcworks
Copy link

Just configure CASino to use the Redmine database as a backend with someting like that : http://casino.rbcas.com/docs/configuration/#database-1

@b-solution
Copy link
Author

Redmine work differently, it use SHA1 twice so i changed the validate function inside casino-activerecord_authenticator gem as a new gem on my side.

def validate(username, password)
user = @model.send("find_by_#{@options[:username_column]}!", username)
password_from_database = user.send(@options[:password_column])
if @options[:is_redmine]
salt = user.send('salt')
if Digest::SHA1.hexdigest("#{salt}#{Digest::SHA1.hexdigest password}") == password_from_database
user_data(user)
else
return false
end
else
if valid_password?(password, password_from_database)
user_data(user)
else
false
end
end

Ofcourse, i added an option is_redmine in cas.yml
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants