Sha256: e19f9ef0556cacb3abeb78857e0e718d9fb5d85dd4aaecf56ec5b02dc707d2d2
Contents?: true
Size: 1.58 KB
Versions: 1
Compression:
Stored size: 1.58 KB
Contents
module OmniAuth module Strategies class Shibboleth include OmniAuth::Strategy option :shib_session_id_field, 'Shib-Session-ID' option :shib_application_id_field, 'Shib-Application-ID' option :uid_field, 'eppn' option :name_field, 'displayName' option :info_fields, {} option :extra_fields, [] option :debug, false def request_phase [ 302, { 'Location' => script_name + callback_path + query_string, 'Content-Type' => 'text/plain' }, ["You are being redirected to Shibboleth SP/IdP for sign-in."] ] end def callback_phase if options[:debug] # dump attributes return [ 200, { 'Content-Type' => 'text/plain' }, [request.env.sort.map {|i| "#{i[0]}: #{i[1]}" }.join("\n")] ] end return fail!(:no_shibboleth_session) unless (request.env[options.shib_session_id_field.to_s] || request.env[options.shib_application_id_field.to_s]) super end uid do request.env[options.uid_field.to_s] end info do res = { :name => request.env[options.name_field.to_s] } options.info_fields.each_pair do |k,v| res[k] = request.env[v.to_s] end res end extra do options.extra_fields.inject({:raw_info => {}}) do |hash, field| hash[:raw_info][field] = request.env[field.to_s] hash end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
omniauth-shibboleth-1.0.7 | lib/omniauth/strategies/shibboleth.rb |