Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing rails4 compatibility #69

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

fixing rails4 compatibility #69

wants to merge 5 commits into from

Conversation

mp-jgoetzinger
Copy link

hey, as i needed to extend the client a bit and we're working on rails4 i first had to get the specs passing. these are the changes i made. i also had to bump the database_cleaner version to 1.0.1 (which is working with rails4 but all versions > 1.1 currently don't work with sqlite).

i'm going to open another PR for the extension i made to the client. then you can decide if this would be useful for other people as well.

cheers,
johannes.

@mp-jgoetzinger
Copy link
Author

oh, didn't take care of the .travis configuration. will try to fix it soon (and add rails4)


# wrapper around ActionDispatch::Session::ActiveRecordStore
# as ActiveRecord::SessionStore.session_class doesn't exist in rails4
module ActiveRecord

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be working as intended? Unless I'm missing something.

NoMethodError - undefined method `session_class' for ActiveRecord::SessionStore:Module:
   () Users/altonymous/.rvm/gems/ruby-2.0.0-p353@client/bundler/gems/rubycas-client-f1b17063b824/lib/casclient/tickets/storage.rb:32:in `get_session_for_service_ticket'
   () Users/altonymous/.rvm/gems/ruby-2.0.0-p353@client/bundler/gems/rubycas-client-f1b17063b824/lib/casclient/tickets/storage.rb:13:in `process_single_sign_out'
   () Users/altonymous/.rvm/gems/ruby-2.0.0-p353@client/bundler/gems/rubycas-client-f1b17063b824/lib/casclient/frameworks/rails/filter.rb:300:in `single_sign_out'
   () Users/altonymous/.rvm/gems/ruby-2.0.0-p353@client/bundler/gems/rubycas-client-f1b17063b824/lib/casclient/frameworks/rails/filter.rb:28:in `filter'

@mp-jgoetzinger
Copy link
Author

oh, almost forgot about that pull request.. sorry for the late answer. as far as i can remember, in rails4 this has been separated into it's own gem as you can see here https://github.com/mp-dhorsak/rubycas-client/blob/f1b17063b824565fef6a6c6259ad484885847042/Appraisals#L19

cheers

@cthielen
Copy link

I did my own work fixing up for Rails 4.1 compatibility and this pull request is more or less what I ended up having to do.

activerecord-session_store is required for Rails 4.x compatibility, that feature has been removed from Rails. It works fine in 4.0 and 4.1 but is technically deprecated so supporting single sign out via some other method would be a good idea.

Is there any reason it hasn't been merged?

@cthielen
Copy link

I also had to change the ServiceTicketAwareSession class in active_record_ticket_store.rb to use data["service_ticket"], not data[:service_ticket]. Not sure why.

@cthielen
Copy link

The documentation is either out-of-date for Rails 4.x or out-of-date generally.

In order to use single sign out you must not only specify enable_single_sign_out but also set :ticket_store => :active_record_ticket_store. One must also create a service_ticket column. None of this is mentioned in the docs!

(Note, I'm putting this here as perhaps the ticket_store requirement only applies to the Rails 4 case, which uses the activerecord-session_store gem, but perhaps not.)

@lutinwood
Copy link

Hi ,

Sorry I get lost ! how are we supose to install plugin in rails 4 ?

in rails 3 .X : rails plugin install https://github.com/rubycas/rubycas-client.git.

thanks for any help!

@romainbutteaud
Copy link

Thanks @mp-jgoetzinger, it works great for Rails 4.1. Exactly what I needed! @cthielen, your fork works great too.
+1 to merge this or @cthielen's.

@lutinwood, you need to use @mp-jgoetzinger's commits to use this gem with Rails 4. You can do that by adding this line gem 'rubycas-client', :git => "https://github.com/mp-dhorsak/rubycas-client" in your Gemfile.

@ipstatic
Copy link

Since 4.1 has been released, is there any plans on merging this into master and releasing an updated gem?

@romainbutteaud
Copy link

+1
@brodock, @soupmatt, @zuk any updates?

@rivsc
Copy link

rivsc commented Sep 4, 2014

"mp-dhorsak/rubycas-client" seems to be removed. Any solutions for rails 4.1 apps ?

@romainbutteaud
Copy link

@rivsc I made my own fork out of @cthielen that works with Rails 4.1.
https://github.com/RomainButteaud/rubycas-client

@rivsc
Copy link

rivsc commented Sep 10, 2014

@romainbutteaud Thanks for your reply. Finally, I added

gem 'rubycas-client', :git => 'git://github.com/rubycas/rubycas-client.git'

And this in my application_controller :

before_action CASClient::Frameworks::Rails::Filter

I use Rails 4.1.2, It seems to work.

@jrochkind
Copy link

Are there any plans to release a version of this gem that works under Rails 4? Is this gem still actively maintained/supported?

@zuk
Copy link
Member

zuk commented Feb 22, 2015

I'm not actively involved in the gem anymore, but from what I occasionally
see on GitHub and on this mailing list, a number of people are keeping it
going. Not sure what the plans are for Rails 4, but hopefully someone else
will chime in.

On Sat, Feb 21, 2015 at 1:02 PM, Jonathan Rochkind <notifications@github.com

wrote:

Are there any plans to release a version of this gem that works under
Rails 4? Is this gem still actively maintained/supported?


Reply to this email directly or view it on GitHub
#69 (comment).

@akshaysn1991
Copy link

akshaysn1991 commented Dec 13, 2016

environment.rb

CASClient::Frameworks::Rails::Filter.configure(
:cas_base_url => "http://localhost:8888/",
:enable_single_sign_out => true,
:ticket_store => :active_record_ticket_store
)
these are my settings. registrations, login are working fine.
But I am getting below error when i am signing out. any help would be appreciated
NoMethodError (undefined method `ticket_store' for #CASClient::Client:0x00000004e61578):

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

Successfully merging this pull request may close these issues.

None yet