Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
package edu.yale.its.tp.cas.auth.provider;

import edu.yale.its.tp.cas.auth.*;

/** A simple, dummy authenticator. */
public class SampleHandler extends WatchfulPasswordHandler {

    public boolean authenticate(javax.servlet.ServletRequest request,
                                String username,
                                String password) {

        /*
         *  If the username doesn't equal the password, register the failure with our superclass
         *  and return false.
         */
        if (!username.equals(password)) {
                super.registerFailure(request);
                return false;
        }

        /* Allow WatchfulPasswordHandler to veto the authentication */
        return super.authenticate(request, username, password);
    }
}

---------------------

...

Thoughts

I would suggest that the marker interface is not needed here. The work of a CAS AuthHandler is to examine an HttpServletRequest and to assert one of the following:

...