Sha256: c959a9a055324d336cdb9f09d4aa28f8b0739173074d5138afb8784abae49b60

Contents?: true

Size: 1.01 KB

Versions: 19

Compression:

Stored size: 1.01 KB

Contents

# A more advanced example.
# For basic usage see the SimpleExampleController.
class AdvancedExampleController < ApplicationController
  # This will allow the user to view the index page without authentication
  # but will process CAS authentication data if the user already
  # has an SSO session open.
  before_filter CASClient::Frameworks::Rails::GatewayFilter, :only => :index

  # This requires the user to be authenticated for viewing allother pages.
  before_filter CASClient::Frameworks::Rails::Filter, :except => :index

  def index
    @username = session[:cas_user]
    
    @login_url = CASClient::Frameworks::Rails::Filter.login_url(self)
  end

  def my_account
    @username = session[:cas_user]

    # Additional user attributes are available if your
    # CAS server is configured to provide them.
    # See http://code.google.com/p/rubycas-server/wiki/HowToSendExtraUserAttributes
    @extra_attributes = session[:cas_extra_attributes]
  end

  def logout
    CASClient::Frameworks::Rails::Filter.logout(self)
  end

end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
rubycas-client-2.3.10.rc1 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.9 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.9.rc1 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.8 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.7 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.6 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.5 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.3 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.2 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.1 examples/rails/app/controllers/advanced_example_controller.rb
rubycas-client-2.3.0.rc1 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha8 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha7 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha6 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha5 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha4 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha3 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha2 examples/rails/app/controllers/advanced_example_controller.rb
vibes-rubycas-client-2.3.0.alpha examples/rails/app/controllers/advanced_example_controller.rb