Title: LDAP Authentication
Notice: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
The authentication in the Apache Rave portal is handled through Spring Security.
The supported login mechanisms are currently basic authentication with users stored in the database, OpenId and, since
version 0.8-incubating, LDAP.
When an LDAP user logs in for the first time in the Apache Rave portal, a user profile in the portal is created with the
same username, email address and display name as in the LDAP. When this user logs in again, he is still authenticated
against the LDAP server.
## Demo login
For the LDAP authentication the demo setup comes with an embedded ApacheDS.
To login with the demo setup the following credentials can be used:
* johnldap/johnldap
* janeldap/janeldap
## LDAP configuration
The demo setup of the Apache Rave portal is configured to use an embedded ApacheDS, populated by a users.ldiff file:
Authentication is handled by LDAP first. If this fails, Spring Security tries the basic authentication against the
database:
An Apache Rave portal specific class maps the authenticated LDAP user to an Apache Rave portal profile:
With "mailAttributeName" and "displayNameAttributeName" you can configure the names of the attributes from your own LDAP
that contain the mail address and display name for a user. When the LdapUserDetailsContextMapper create a user profile,
the user gets access to the portal and gets the layout configured in "pageLayoutCode".
## Customizing the LDAP setup
First create a custom portal project. There are multiple ways to build your custom Apache Rave instance, but the quickest is to
use a Maven WAR overlay. See [Extending Rave](rave-extensions.html) for an example overlay.
For the LDAP configuration, the default applicationContext-security.xml needs to be overridden.
### LDAP as only authentication provider
If you don't want the fallback to the database for authentication, remove:
### External LDAP server
The following line is configured to use the embedded ApacheDS:
To use an external LDAP server, replace it with:
## Reference
* [Spring Security LDAP documentation](http://static.springsource.org/spring-security/site/docs/3.1.x/reference/ldap.html)
* [ApacheDS](http://directory.apache.org/apacheds/1.5/)