## org.mortbay.jetty.security
Class FormAuthenticator

    java.lang.Object
      org.mortbay.jetty.security.FormAuthenticator

All Implemented Interfaces:
  Serializable, Authenticator

    public class FormAuthenticator

extends Object
implements Authenticator

FORM Authentication Authenticator. The HTTP Session is used to store the authentication status of the user, which can be distributed. If the realm implements SSORealm, SSO is supported.

Author:
  Greg Wilkins (gregw), dan@greening.name
See Also:
  Serialized Form

Field Summary
`static String` `__J_AUTHENTICATED`
`static String` `__J_PASSWORD`
`static String` `__J_SECURITY_CHECK`
`static String` `__J_URI`
`static String` `__J_USERNAME`

Constructor Summary
`FormAuthenticator()`

Method Summary
`Principal` `authenticate(UserRealm realm, String pathInContext, Request request, Response response)` Perform form authentication.
`String` `getAuthMethod()`
`String` `getErrorPage()`
`String` `getLoginPage()`
`boolean` `isLoginOrErrorPage(String pathInContext)`
`void` `setErrorPage(String path)`
`void` `setLoginPage(String path)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### __J_URI

    public static final String __J_URI

See Also:
  Constant Field Values

### __J_AUTHENTICATED

    public static final String __J_AUTHENTICATED

See Also:
  Constant Field Values

### __J_SECURITY_CHECK

    public static final String __J_SECURITY_CHECK

See Also:
  Constant Field Values

### __J_USERNAME

    public static final String __J_USERNAME

See Also:
  Constant Field Values

### __J_PASSWORD

    public static final String __J_PASSWORD

See Also:
  Constant Field Values

Constructor Detail

### FormAuthenticator

    public FormAuthenticator()

Method Detail

### getAuthMethod

    public String getAuthMethod()

  Specified by:
    `getAuthMethod` in interface `Authenticator`

### setLoginPage

    public void setLoginPage(String path)

### getLoginPage

    public String getLoginPage()

### setErrorPage

    public void setErrorPage(String path)

### getErrorPage

    public String getErrorPage()

### authenticate

    public Principal authenticate(UserRealm realm,
                                  String pathInContext,
                                  Request request,
                                  Response response)
                           throws IOException

  Perform form authentication. Called from SecurityHandler.

  Specified by:
    `authenticate` in interface `Authenticator`
  Parameters:
    `realm` - an `UserRealm` value
    `pathInContext` - a `String` value
    `request` - a `Request` value
    `response` - a `Response` value. If non-null response is passed, then a failed authentication will result in a challenge response being set in the response.
  Returns:
    UserPrincipal if authenticated else null.
  Throws:
    `IOException` - if an error occurs

### isLoginOrErrorPage

    public boolean isLoginOrErrorPage(String pathInContext)

Copyright © 1995-2008 Mort Bay Consulting. All Rights Reserved.