Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F904964
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Aug 29, 6:25 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Sun, Aug 31, 6:25 PM (1 d, 5 h)
Engine
blob
Format
Raw Data
Handle
252356
Attached To
rWEBDNS WebDNS (edet4)
View Options
diff --git a/lib/devise/strategies/saml.rb b/lib/devise/strategies/saml.rb
index 2600bc4..dfb858e 100644
--- a/lib/devise/strategies/saml.rb
+++ b/lib/devise/strategies/saml.rb
@@ -1,53 +1,53 @@
require 'securerandom'
require 'devise/strategies/authenticatable'
module Devise
module Strategies
class SamlAuthenticatable < Authenticatable
def valid?
return false unless persistent_id.present?
return false unless mail.present?
return true if WebDNS.settings[:saml_required_entitlement].nil?
entitlement.present? &&
entitlement.include?(WebDNS.settings[:saml_required_entitlement])
end
def authenticate!
if !WebDNS.settings[:saml]
return fail!('SAML is disabled')
end
- identifier = ['saml', persistent_id].join(':')
+ identifier = ['saml', remote_user].join(':')
user = mapping.to.find_or_initialize_by(identifier: identifier)
return fail!('Wrong credentials') unless user
# Update user attributes
user.email = mail
user.password = SecureRandom.hex(15) if user.new_record?
user.save!
success!(user)
end
private
- def persistent_id
- request.headers['PERSISTENT-ID']
+ def remote_user
+ request.headers['REMOTE-USER']
end
def mail
request.headers['MAIL']
end
def entitlement
request.headers['ENTITLEMENT']
end
end
end
end
Warden::Strategies.add(:saml, Devise::Strategies::SamlAuthenticatable)
Event Timeline
Log In to Comment