Module: Authpds::Session::InstanceMethods
- Defined in:
- lib/authpds/session.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#login_url(params = {}) ⇒ Object
URL to redirect to for login.
-
#logout_url(params = {}) ⇒ Object
URL to redirect to after logout.
- #pds_user ⇒ Object
-
#sso_url(params = {}) ⇒ Object
URL to redirect to in the case of establishing a SSO session.
Class Method Details
.included(klass) ⇒ Object
141 142 143 144 145 |
# File 'lib/authpds/session.rb', line 141 def self.included(klass) klass.class_eval do "#{calling_system}_credentials" end end |
Instance Method Details
#login_url(params = {}) ⇒ Object
URL to redirect to for login. Preceded by :before_login
149 150 151 |
# File 'lib/authpds/session.rb', line 149 def login_url(params={}) return "#{self.class.pds_url}/pds?func=load-login&institute=#{institution_attributes["link_code"]}&calling_system=#{self.class.calling_system}&url=#{CGI::escape(validate_url(params))}" end |
#logout_url(params = {}) ⇒ Object
URL to redirect to after logout.
154 155 156 |
# File 'lib/authpds/session.rb', line 154 def logout_url(params={}) return "#{self.class.pds_url}/pds?func=logout&url=#{CGI::escape(controller.user_session_redirect_url(self.class.redirect_logout_url))}" end |
#pds_user ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/authpds/session.rb', line 163 def pds_user begin @pds_user ||= Authpds::Exlibris::Pds::BorInfo.new(self.class.pds_url, self.class.calling_system, pds_handle) unless pds_handle.nil? return @pds_user unless @pds_user.nil? or @pds_user.error rescue Exception => e # Delete the PDS_HANDLE, since this isn't working. # controller.cookies.delete(:PDS_HANDLE) unless pds_handle.nil? handle_login_exception e return nil end end |
#sso_url(params = {}) ⇒ Object
URL to redirect to in the case of establishing a SSO session.
159 160 161 |
# File 'lib/authpds/session.rb', line 159 def sso_url(params={}) return "#{self.class.pds_url}/pds?func=sso&institute=#{institution_attributes["link_code"]}&calling_system=#{self.class.calling_system}&url=#{CGI::escape(validate_url(params))}" end |