Module | Picnic::Authentication::Cas |
In: |
lib/picnic/authentication.rb
|
Picnic::Authentication::Cas provides basic CAS (Central Authentication System) authentication for your Camping app.
To learn more about CAS, see rubycas-client.googlecode.com and www.ja-sig.org/products/cas.
The module defines a service method that intercepts every request to check for CAS authentication. If the user has already been authenticated, the request proceeds as normal and the authenticated user‘s username is made available under <tt>@state[:cas_username]. Otherwise the request is redirected to your CAS server for authentication.
To activate CAS authentication for your application:
authentication: cas_base_url: https://login.example.com/cas
Where the value for </tt>cas_base_url</tt> is the URL of your CAS server.
For some reason the Module#included callback is just not working for me, so I had to resort to overriding append_features(). If anyone has any ideas why, please let me know!