Unsupported Release

This documentation relates to DSpace 1.8.x, an old, unsupported version. Looking for another version? See all documentation.

As of January 2015, DSpace 1.8.x is no longer supported. We recommend upgrading to a more recent version of DSpace. See DSpace Software Support Policy.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Authentication Plugins

Stackable Authentication Method(s)

Since many institutions and organizations have existing authentication systems, DSpace has been designed to allow these to be easily integrated into an existing authentication infrastructure. It keeps a series, or "stack", of authentication methods, so each one can be tried in turn. This makes it easy to add new authentication methods or rearrange the order without changing any existing code. You can also share authentication code with other sites.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="59f88c70-75bf-4847-8cb7-f3e387cc572e"><ac:plain-text-body><![CDATA[

Configuration File:

[dspace]/config/modules/authentication.cfg

]]></ac:plain-text-body></ac:structured-macro>

Property:

plugin.sequence.org.dspace.authenticate.AuthenticationMethod

Example Value:

plugin.sequence.org.dspace.authenticate.AuthenticationMethod = \
 org.dspace.authenticate.PasswordAuthentication

The configuration property plugin.sequence.org.dspace.authenticate.AuthenticationMethod defines the authentication stack. It is a comma-separated list of class names. Each of these classes implements a different authentication method, or way of determining the identity of the user. They are invoked in the order specified until one succeeds.

An authentication method is a class that implements the interface org.dspace.authenticate.AuthenticationMethod. It authenticates a user by evaluating the credentials (e.g. username and password) he or she presents and checking that they are valid.

The basic authentication procedure in the DSpace Web UI is this:

  1. A request is received from an end-user's browser that, if fulfilled, would lead to an action requiring authorization taking place.
  2. If the end-user is already authenticated:
    • If the end-user is allowed to perform the action, the action proceeds
    • If the end-user is NOT allowed to perform the action, an authorization error is displayed.
    • If the end-user is NOT authenticated, i.e. is accessing DSpace anonymously:
  3. The parameters etc. of the request are stored.
  4. The Web UI's startAuthentication method is invoked.
  5. First it tries all the authentication methods which do implicit authentication (i.e. they work with just the information already in the Web request, such as an X.509 client certificate). If one of these succeeds, it proceeds from Step 2 above.
  6. If none of the implicit methods succeed, the UI responds by putting up a "login" page to collect credentials for one of the explicit authentication methods in the stack. The servlet processing that page then gives the proffered credentials to each authentication method in turn until one succeeds, at which point it retries the original operation from Step 2 above.
    Please see the source files AuthenticationManager.java and AuthenticationMethod.java for more details about this mechanism.

Shibboleth Authentication Configuration Settings

Detailed instructions for installing Shibboleth on DSpace may be found at https://mams.melcoe.mq.edu.au/zope/mams/pubs/Installation/dspace15.

DSpace requires email as the user's credentials. There are two ways of providing email to DSpace:

  1. By explicitly specifying to the user which attribute (header) carries the email address.
  2. By turning on the user-email-using-tomcat=true which means the software will attempt to acquire the user's email from Tomcat.
    The first option takes Precedence when specified. both options can be enabled to allow for fallback.

    Property:

    authentication.shib.email-header

    Example Value:

    authentication.shib.email-header = MAIL

    Informational Note:

    The option specifies that the email comes from the mentioned header. This value is CASE-Sensitive.

    Property:

    authentication.shib.firstname-header

    Example Value:

    authentication.shib.firstname-header = SHIB-EP-GIVENNAME

    Informational Note:

    Optional. Specify the header that carries the user's first name. This is going to be used for the creation of new-user.

    Property:

    authentication.shib.lastname-header

    Example Value:

    authentication.shib.lastname-header = SHIB-EP-SURNAME

    Informational Note:

    Optional. Specify the header that carries user's last name. This is used for creation of new user.

    Property:

    authentication.shib.email-use-tomcat-remote-user

    Example Value:

    authentication.shib.email-use-tomcat-remote-user = true

    Informational Note:

    This option forces the software to acquire the email from Tomcat.

    Property:

    authentication.shib.autoregister

    Example Value:

    authentication.shib.autoregister = true

    Informational Note:

    Option will allow new users to be registered automatically if the IdP provides sufficient information (and the user does not exist in DSpace).

    Property:

    authentication.shib.role-header
    authentication.shib-role.header.ignore-scope

    Example Value:

    authentication.shib.role-header = Shib-EP-ScopedAffiliation
    authentication.shib-role.header.ignore-scope = true

    or

    authentication.shib.role-header = Shib-EP-UnscopedAffiliation
     authentication.shib-role.header.ignore-scope = false

    Informational Note:

    These two options specify which attribute that is responsible for providing user's roles to DSpace and unscope the attributes if needed. When not specified, it is defaulted to 'Shib-EP-UnscopedAffiliation', and ignore-scope is defaulted to 'false'. The value is specified in AAP.xml (Shib 1.3.x) or attribute-filter.xml (Shib 2.x). The value is CASE-Sensitive. The values provided in this header are separated by semi-colon or comma. If your service provider (SP) only provides scoped role header, you need to set authentication.shib.role-header.ignore-Scope as 'true'. For example if you only get Shib-EP-ScopedAffiliation instead of Shib-EP-ScopedAffiliation, you name to make your settings as in the example value above.

    Property:

    authentication.shib.default-roles

    Example Value:

    authentication.shib.default-roles = Staff, Walk-ins

    Informational Note:

    When user is fully authN or IdP but would not like to release his/her roles to DSpace (for privacy reasons?), what should the default roles be given to such user. The values are separated by semi-colon or comma.

    Property:

    authentication.shib.role.Senior\ Researcher
    authentication.shib.role.Librarian

    Example Value:

    authentication.shib.role.Senior\ Researcher = Researcher, Staff
    authentication.shib.role.Librarian = Administrator

    Informational Note:

    The following mappings specify role mapping between IdP and Dspace. The left side of the entry is IdP's role (prefixed with 'authentication.shib.role.') which will be mapped to the right entry from DSpace. DSpace's group as indicated on the right entry has to EXIST in DSpace, otherwise user will be identified as 'anonymous'. Multiple values on the right entry should be separated by comma. The values are CASE-Sensitive. Heuristic one-to-one mapping will be done when the IdP groups entry are not listed below (i.e. if 'X' group in IdP is not specified here, then it will be mapped to 'X' group in DSpace if it exists, otherwise it will be mapped to simply 'anonymous'). Given sufficient demand, future release could support regex for the mapping special characters need to be escaped by '\'

Authentication by Password

The default method org.dspace.authenticate.PasswordAuthentication has the following properties:

  • Use of inbuilt e-mail address/password-based log-in. This is achieved by forwarding a request that is attempting an action requiring authorization to the password log-in servlet, /password-login. The password log-in servlet (org.dspace.app.webui.servlet.PasswordServlet) contains code that will resume the original request if authentication is successful, as per step 3. described above.
  • Users can register themselves (i.e. add themselves as e-people without needing approval from the administrators), and can set their own passwords when they do this
  • Users are not members of any special (dynamic) e-person groups
  • You can restrict the domains from which new users are able to register. To enable this feature, uncomment the following line from dspace.cfg: authentication.password.domain.valid = example.com Example options might be '@example.com' to restrict registration to users with addresses ending in @example.com, or '@example.com, .ac.uk' to restrict registration to users with addresses ending in @example.com or with addresses in the .ac.uk domain.

X.509 Certificate Authentication

The X.509 authentication method uses an X.509 certificate sent by the client to establish his/her identity. It requires the client to have a personal Web certificate installed on their browser (or other client software) which is issued by a Certifying Authority (CA) recognized by the web server.

  1. See the HTTPS installation instructions to configure your Web server. If you are using HTTPS with Tomcat, note that the <Connector> tag must include the attribute clientAuth="true" so the server requests a personal Web certificate from the client.
  2. Add the org.dspace.authenticate.X509Authentication plugin first to the list of stackable authentication methods in the value of the configuration key plugin.sequence.org.dspace.authenticate.AuthenticationMethod e.g.:
    plugin.sequence.org.dspace.authenticate.AuthenticationMethod = \
         org.dspace.authenticate.X509Authentication, \
         org.dspace.authenticate.PasswordAuthentication
  1. You must also configure DSpace with the same CA certificates as the web server, so it can accept and interpret the clients' certificates. It can share the same keystore file as the web server, or a separate one, or a CA certificate in a file by itself. Configure it by one of these methods, either the Java keystore
    authentication.x509.keystore.path =  path to Java keystore file
     authentication.x509.keystore.password =  password to access the keystore
    ...or the separate CA certificate file (in PEM or DER format):
    authentication.x509.ca.cert =  path to certificate file for CA
                                         whose client certs to accept.
  2. Choose whether to enable auto-registration: If you want users who authenticate successfully to be automatically registered as new E-Persons if they are not already, set the authentication.x509.autoregister configuration property to true. This lets you automatically accept all users with valid personal certificates. The default is false.

Example of a Custom Authentication Method

Also included in the source is an implementation of an authentication method used at MIT, edu.mit.dspace.MITSpecialGroup. This does not actually authenticate a user, it only adds the current user to a special (dynamic) group called 'MIT Users' (which must be present in the system!). This allows us to create authorization policies for MIT users without having to manually maintain membership of the MIT users group.

By keeping this code in a separate method, we can customize the authentication process for MIT by simply adding it to the stack in the DSpace configuration. None of the code has to be touched.

You can create your own custom authentication method and add it to the stack. Use the most similar existing method as a model, e.g. org.dspace.authenticate.PasswordAuthentication for an "explicit" method (with credentials entered interactively) or org.dspace.authenticate.X509Authentication for an implicit method.

Configuring IP Authentication

You can enable IP authentication by adding its method to the stack in the DSpace configuration, e.g.:

plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.IPAuthentication

You are then able to map DSpace groups to IP addresses in dspace.cfg by setting authentication.ip.GROUPNAME = iprange[, iprange ...], e.g:

authentication.ip.MY_UNIVERSITY = 10.1.2.3, \                  # Full IP
                                  13.5, \                      # Partial IP
                                  11.3.4.5/24, \               # with CIDR
                                  12.7.8.9/255.255.128.0,      # with netmask
                                  2001:18e8::/32               # IPv6 too

Negative matches can be set by prepending the entry with a '-'. For example if you want to include all of a class B network except for users of a contained class c network, you could use: 111.222,-111.222.333.

Notes:

  • If the Groupname contains blanks you must escape the, e.g. Department\ of\ Statistics
  • If your DSpace installation is hidden behind a web proxy, remember to set the 'useProxies' configuration option within the 'Logging' section of dspace.cfg to use the IP address of the user rather than the IP address of the proxy server.

Configuring LDAP Authentication

You can enable LDAP authentication by adding its method to the stack in the DSpace configuration, e.g.

plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
                     org.dspace.authenticate.LDAPAuthentication

If LDAP is enabled in the dspace.cfg file, then new users will be able to register by entering their username and password without being sent the registration token. If users do not have a username and password, then they can still register and login with just their email address the same way they do now.

If you want to give any special privileges to LDAP users, create a stackable authentication method to automatically put people who have a netid into a special group. You might also want to give certain email addresses special privileges. Refer to the Custom Authentication Code section above for more information about how to do this.

Here is an explanation of what each of the different configuration parameters are for:

Standard LDAP Configuration

Property:

ldap.enable

Example Value:

ldap.enable = false

Informational Note:

This setting will enable or disable LDAP authentication in DSpace. With the setting off, users will be required to register and login with their email address. With this setting on, users will be able to login and register with their LDAP user ids and passwords.

Property:

ldap.provider_url

Example Value:

ldap.provider_url = ldap://ldap.myu.edu/o=myu.edu

Informational Note:

This is the url to your institution's LDAP server. You may or may not need the /o=myu.edu part at the end. Your server may also require the ldaps:// protocol.

Property:

ldap.id_field

Example Value:

ldap.id_field = uid

Explanation:

This is the unique identifier field in the LDAP directory where the username is stored.

Property:

ldap.object_context

Example Value:

ldap.object_context = ou=people, o=myu.edu

Informational Note:

This is the object context used when authenticating the user. It is appended to the ldap.id_field and username. For example uid=username,ou=people,o=myu.edu. You will need to modify this to match your LDAP configuration.

Property:

ldap.search_context

Example Value:

ldap.search_context = ou=people

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2a45e6a8-90af-4dd2-8585-9348fa6b0600"><ac:plain-text-body><![CDATA[

Informational Note:

This is the search context used when looking up a user's LDAP object to retrieve their data for autoregistering. With ldap.autoregister turned on, when a user authenticates without an EPerson object we search the LDAP directory to get their name and email address so that we can create one for them. So after we have authenticated against uid=username,ou=people,o=byu.edu we now search in ou=people for filtering on [uid=username]. Often the ldap.search_context is the same as the ldap.object_context parameter. But again this depends on your LDAP server configuration.

]]></ac:plain-text-body></ac:structured-macro>

Property:

ldap.email_field

Example Value:

ldap.email_field = mail

Informational Note:

This is the LDAP object field where the user's email address is stored. "mail" is the default and the most common for LDAP servers. If the mail field is not found the username will be used as the email address when creating the eperson object.

Property:

ldap.surname_field

Example Value:

ldap.surname_field = sn

Informational Note:

This is the LDAP object field where the user's last name is stored. "sn" is the default and is the most common for LDAP servers. If the field is not found the field will be left blank in the new eperson object.

Property:

ldap.givenname_field

Example Value:

ldap.givenname_field = givenName

Informational Note:

This is the LDAP object field where the user's given names are stored. I'm not sure how common the givenName field is in different LDAP instances. If the field is not found the field will be left blank in the new eperson object.

Property:

ldap.phone_field

Example Value:

ldap.phone_field = telephoneNumber

Informational Note:

This is the field where the user's phone number is stored in the LDAP directory. If the field is not found the field will be left blank in the new eperson object.

Property:

webui.ldap.autoregister

Example Value:

webui.ldap.autoregister = true

Informational Note:

This will turn LDAP autoregistration on or off. With this on, a new EPerson object will be created for any user who successfully authenticates against the LDAP server when they first login. With this setting off, the user must first register to get an EPerson object by entering their ldap username and password and filling out the forms.

LDAP Users Group

Property:

ldap.login.specialgroup

Example Value:

ldap.login.specialgroup = group-name

Informational Note:

If required, a group name can be given here, and all users who log into LDAP will automatically become members of this group. This is useful if you want a group made up of all internal authenticated users. (Remember to log on as the administrator, add this to the "Groups" with read rights).

Hierarchical LDAP Settings. If your users are spread out across a hierarchical tree on your LDAP server, you will need to use the following stackable authentication class:

plugin.sequence.org.dspace.authenticate.AuthenticationMethod = \
       org.dspace.authenticate.LDAPHierarchicalAuthentication

You can optionally specify the search scope. If anonymous access is not enabled on your LDAP server, you will need to specify the full DN and password of a user that is allowed to bind in order to search for the users.

Property:

ldap.search_scope

Example Value:

ldap.search_scope = 2

Informational Note:

This is the search scope value for the LDAP search during autoregistering. This will depend on your LDAP server setup. This value must be one of the following integers corresponding to the following values:
object scope : 0
one level scope : 1
subtree scope : 2

Property:

ldap.search.user
ldap.search.password

Example Value:

ldap.search.user = cn=admin,ou=people,o=myu.edu
{{ ldap.search.password = password}}

Informational Note:

The full DN and password of a user allowed to connect to the LDAP server and search for the DN of the user trying to log in. If these are not specified, the initial bind will be performed anonymously.

Property:

ldap.netid_email_domain

Example Value:

ldap.netid_email_domain = @example.com

Informational Note:

If your LDAP server does not hold an email address for a user, you can use the following field to specify your email domain. This value is appended to the netid in order to make an email address. E.g. a netid of 'user' and ldap.netid_email_domain as @example.com would set the email of the user to be user@example.com

  • No labels