Skip to content

Commit

Permalink
cleanup the debug output for ldap strategy
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:intridea/omniauth

Conflicts:
	oa-enterprise/lib/omniauth/strategies/ldap.rb
  • Loading branch information
Ping Yu committed Oct 4, 2010
2 parents 3443188 + 3e5963f commit 9624081
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ OmniAuth currently supports the following external providers:
* GitHub
* OpenID
* Google Apps (via OpenID)
* CAS (Central Authentication Service)
* LDAP

## Usage

Expand Down
5 changes: 1 addition & 4 deletions oa-enterprise/lib/omniauth/strategies/ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class LDAP
include OmniAuth::Strategy

autoload :Adaptor, 'omniauth/strategies/ldap/adaptor'
puts Dir.entries(".")
@@config = {'first_name' => 'givenName', 'last_name' => 'sn', 'email' => ['mail', "email", 'userPrincipalName'],
'phone' => ['telephoneNumber', 'homePhone', 'facsimileTelephoneNumber'],
'mobile_number' => ['mobile', 'mobileTelephoneNumber'],
Expand Down Expand Up @@ -45,7 +44,6 @@ def perform
@adaptor.bind(:bind_dn => request.POST['username'], :password => request.POST['password'])
@ldap_user_info = @adaptor.search(:filter => Net::LDAP::Filter.eq(@adaptor.uid, request.POST['username']),:limit => 1)
@user_info = self.class.map_user(@@config, @ldap_user_info)
puts @user_info
request.POST['auth'] = auth_hash
@env['REQUEST_METHOD'] = 'GET'
@env['PATH_INFO'] = "#{OmniAuth.config.path_prefix}/#{name}/callback"
Expand Down Expand Up @@ -82,8 +80,7 @@ def self.map_user mapper, object
pattern = key1.dup
value1.each_with_index do |v,i|
part = '';
v.each {|v1| puts v1.inspect; (part = object[v1.downcase.to_sym].to_s; break;) if object[v1.downcase.to_sym]}
puts part
v.each {|v1| (part = object[v1.downcase.to_sym].to_s; break;) if object[v1.downcase.to_sym]}
pattern.gsub!("%#{i}",part||'')
end
user[key] = pattern
Expand Down
1 change: 0 additions & 1 deletion oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def search(options={}, &block)
puts args.inspect
attributes = {}
execute(:search, args) do |entry|
puts entry.inspect
entry.attribute_names.each do |name|
attributes[name] = entry[name]
end
Expand Down
1 change: 0 additions & 1 deletion oa-oauth/lib/omniauth/strategies/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def user_info
'name' => user_hash['name'],
'location' => user_hash['location'],
'image' => user_hash['profile_image_url'],
'screen_name' => user_hash['screen_name'],
'description' => user_hash['description'],
'urls' => {'Website' => user_hash['url']}
}
Expand Down

0 comments on commit 9624081

Please sign in to comment.