apache > lenya
 

Authenticators

Introduction

An authenticator is used to identify a client. It is supposed to setup the Identity object which is attached to the session.

Declaring the Roles in lenya.roles

<role name="org.apache.lenya.ac.Authenticator"
    shorthand="authenticator"
    default-class="org.apache.lenya.ac.impl.UserAuthenticator"/>

The user authenticator

The UserAuthenticator uses the request parameters

  • username and
  • password

to authenticate or reject a user. It is configured in cocoon.xconf as follows:

<component logger="lenya.ac.authenticator"
    class="org.apache.lenya.ac.impl.UserAuthenticator"
    role="org.apache.lenya.ac.Authenticator"/>

When a valid username/password combination is entered, the previous user is removed from the session Identity object and the current user is added.

The anonymous authenticator

The AnonymousAuthenticator authenticates the request against the credentials of the user called 'anonymous' (which you have to create, and assign the desired permissions). This is useful in conjunction with client certificates. It is configured in cocoon.xconf as follows (commented out by default):

<component logger="lenya.ac.authenticator"
    class="org.apache.lenya.ac.impl.AnonymousAuthenticator"
    role="org.apache.lenya.ac.Authenticator"/>