LDAP Authentication ProviderΒΆ
The LDAP Authentication Provider uses and LDAP service to authenticate users. It can be configured to use LDAP only for authentication, or also for roles assignment (each LDAP group is a role).
- To configure the provider you have to specify:
- a name for the provider
- the LDAP server url, complete with the root DN (e.g. http://localhost:389/dc=maxcrc,dc=com)
- the User lookup pattern: {0} should be used in place of the username value in the pattern (e.g. uid={0},ou=People)
- use TLS (secure connection) or not to connect to the server
- if using LDAP groups for authorization, groups bound to the LDAP user are used as GeoServer roles, in this case you have to configure also:
- the Group search base (e.g. ou=Groups)
- the Group search filter, a search pattern for locating the LDAP groups a user belongs to. This may contain two placeholder values: {0}, the full DN of the user, for example uid=bob,ou=people,dc=acme,dc=com {1}, the uid portion of the full DN, for example bob
- if NOT using LDAP groups for authorization:
- choose one of the available user/group service for that purpose
We will now add a new LDAP authentication provider, but first we need to add a new user/group service, that the provider will use:
Note
You will need an LDAP server (e.g. OpenLDAP) to do this exercise, the LDAP server is not part of the training material. We assume that an LDAP server is installed on localhost, with a dc=maxcrc,dc=com root and a user with uid ldapuser and password ldapuser exists.
From the Welcome page click the Users, Groups, Roles link on the Menu Security section. .. note:: You have to be logged in as Administrator in order to activate this function.
Click the Add new in the User Group Services menu
- Insert
ldapservice
in theName
text field. - Select
Weak PBE
fromPassword encryption
combo box. - Select
default
fromPassword policy
combo box. - Insert
ldapservice.xml
in theXML filename
text field.
- Insert
Click the Save button.
Now we are going to add a user to the newly added user/group service:
From the Welcome page click the Users, Groups, Roles link on the Menu Security section
Click on the User/Groups tab
Click on the ldapservice link and the user/groups form will appear
Click on the edit link to the right of the ldapservice link
Click on the Users tab
Click on the Add new user button
- Insert
ldapuser
in theUser name
text field - Insert
fake
in thePassword
andConfirm Password
text fields (a password is always required, also if it is not used for authentication) - Select the ADMIN element in the Available list of the Roles taken from active role service: default menu
- Click the arrow right button to add the element to the Selected list
- Insert
Click the Save button.
Now we are ready to add the Authentication provider:
From the Welcome page click the Authentication link on the Menu Security section.
Click Add new in the Authentication Providers menu
Click LDAP in the Authentication Providers list
- Insert
testldap
in theName
text field. - Insert
ldap://localhost:389/dc=maxcrc,dc=com
in theServer URL
text field. - Insert
uid={0},ou=People
in theUser lookup pattern
text field. - Uncheck
Use LDAP groups for authorization
checkbox. - Select
ldapservice
fromUser/Group service
combo box.
- Insert
Click the Save button.
From the Welcome page click the Authentication link on the Menu Security section.
Select the testldap element in the Available list of the Provider Chain menu
Click the arrow right button to add the element to the Selected list
Click the Save button.
Now, we have activated a new Authentication provider, having a new administrator user, named ldaptest. To verify it:
- Click the Logout button on the top right part of the page.
- Isert
ldaptest
in theUsername
and password text fields on the top right part of the page. - Click the Login button on the top right part of the page.
You should be now logged in with the ldaptest user, with administrative rights.