+1.012 xxx
+ - add methods conforming to the Catalyst::Authentication::User API
+ as required here:
+ http://search.cpan.org/dist/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication/Internals.pod#USER_METHODS
+ Nudging provided via RT https://rt.cpan.org/Ticket/Display.html?id=60793
+ - add documentation for Active Directory at suggestion of Adam Wohld
+
1.011 7 July 2010
- fix t/05-user_attributes.t to skip correct number of tests if
Catalyst::Model::LDAP is not installed.
user_basedn => "ou=people,dc=yourcompany,dc=com",
user_field => "uid",
user_filter => "(&(objectClass=posixAccount)(uid=%s))",
- user_scope => "one",
+ user_scope => "one", # or "sub" for Active Directory
user_search_options => { deref => "always" },
user_results_filter => sub { return shift->pop_entry },
},
user_basedn: ou=Domain Users,ou=Accounts,dc=mycompany,dc=com
user_field: samaccountname
- user_filter: (sAMAccountName=%s)
+ user_filter: (sAMAccountName=%s)
+ user_scope: sub
He also notes: "I found the case in the value of user_field to be
significant: it didn't seem to work when I had the mixed case value
}
return undef; # i.e., no match
}
-
+
use_roles
Whether or not to enable role lookups. It defaults to true; set it to 0
if you want to always avoid role lookups.
use strict;
use warnings;
-our $VERSION = '1.011';
+our $VERSION = '1.012';
use Catalyst::Authentication::Store::LDAP::Backend;
user_basedn => "ou=people,dc=yourcompany,dc=com",
user_field => "uid",
user_filter => "(&(objectClass=posixAccount)(uid=%s))",
- user_scope => "one",
+ user_scope => "one", # or "sub" for Active Directory
user_search_options => { deref => "always" },
user_results_filter => sub { return shift->pop_entry },
},
user_basedn: ou=Domain Users,ou=Accounts,dc=mycompany,dc=com
user_field: samaccountname
user_filter: (sAMAccountName=%s)
+ user_scope: sub
He also notes: "I found the case in the value of user_field to be significant:
it didn't seem to work when I had the mixed case value there."
},
'user_basedn' => 'ou=people,dc=yourcompany,dc=com',
'user_filter' => '(&(objectClass=posixAccount)(uid=%s))',
- 'user_scope' => 'one',
+ 'user_scope' => 'one', # or 'sub' for Active Directory
'user_field' => 'uid',
'user_search_options' => {
'deref' => 'always',
use strict;
use warnings;
-our $VERSION = '1.011';
+our $VERSION = '1.012';
use Catalyst::Authentication::Store::LDAP::User;
use Net::LDAP;
use warnings;
use Scalar::Util qw/refaddr/;
-our $VERSION = '1.011';
+our $VERSION = '1.012';
BEGIN { __PACKAGE__->mk_accessors(qw/user store/) }
}
}
+=head2 get
+
+A simple wrapper around has_attribute() to satisfy the Catalyst::Authentication::User API.
+
+=cut
+
+sub get { return shift->has_attribute(@_) }
+
+=head2 get_object
+
+Satisfies the Catalyst::Authentication::User API and returns the contents of the user()
+attribute.
+
+=cut
+
+sub get_object { return shift->user }
+
=head2 ldap_connection
Re-binds to the auth store with the credentials of the user you logged in