Class ServletPrincipalAuthenticator

java.lang.Object
org.eclipse.emf.cdo.server.spi.rest.ServletPrincipalAuthenticator
All Implemented Interfaces:
CDORestAuthenticator

public final class ServletPrincipalAuthenticator extends Object implements CDORestAuthenticator
Maps a principal supplied by a trusted HTTP transport to its CDO user ID.

The default mapping is the exact value returned by Principal.getName(). The authenticator does not inspect request headers and has no dependency on a Servlet API; a Servlet adapter may supply the standard authenticated principal through CDORestRequest.getPrincipal().

Author:
Eike Stepper
  • Field Details

    • FACTORY_TYPE

      public static final String FACTORY_TYPE
      Annotation-factory type used for principal authentication configuration.
      See Also:
  • Constructor Details

    • ServletPrincipalAuthenticator

      public ServletPrincipalAuthenticator()
      Creates the transport-neutral principal authenticator.
  • Method Details

    • authenticate

      public String authenticate(CDORestRequest request, IRepository repository)
      Description copied from interface: CDORestAuthenticator
      Authenticates one request for the addressed repository.
      Specified by:
      authenticate in interface CDORestAuthenticator
      Parameters:
      request - the transport-neutral request, including headers and any trusted transport principal
      repository - the repository selected by the request route
      Returns:
      the opaque CDO user ID associated with the authenticated caller