Interface CDORestAuthenticator

All Known Implementing Classes:
ServletPrincipalAuthenticator, StaticBearerTokenAuthenticator

public interface CDORestAuthenticator
Authenticates one REST request and maps its trusted credentials to an opaque CDO user ID.

Implementations receive transport-neutral request metadata, including copied HTTP headers and an optional principal supplied by a trusted transport. They must support concurrent calls, authenticate every request independently, and return a non-empty user ID without changing its spelling or case. Invalid or missing credentials should result in a CDORestAuthenticationException. Repository authorization remains the responsibility of the repository's configured permission manager.

Authenticator instances are owned by repository exposures. A lifecycle-aware implementation is activated and deactivated with its exposure. Authentication results and credentials are never placed in the managed container.

Author:
Eike Stepper
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Managed-container product group used to create authenticator instances from repository-exposure configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    authenticate(CDORestRequest request, IRepository repository)
    Authenticates one request for the addressed repository.
    default String
    Returns an optional HTTP authentication challenge for missing or invalid credentials.
    default Map<String,Object>
    Returns an optional OpenAPI Security Scheme object for this authenticator.
    default String
    Returns an optional stable name for an OpenAPI security scheme supplied by this authenticator.
  • Field Details

    • PRODUCT_GROUP

      static final String PRODUCT_GROUP
      Managed-container product group used to create authenticator instances from repository-exposure configuration.
      See Also:
  • Method Details

    • authenticate

      String authenticate(CDORestRequest request, IRepository repository)
      Authenticates one request for the addressed repository.
      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
      Throws:
      CDORestAuthenticationException - if the request is missing valid credentials
    • getChallenge

      default String getChallenge()
      Returns an optional HTTP authentication challenge for missing or invalid credentials.
      Returns:
      a value suitable for WWW-Authenticate, or null when no challenge applies
    • getOpenAPISecuritySchemeName

      default String getOpenAPISecuritySchemeName()
      Returns an optional stable name for an OpenAPI security scheme supplied by this authenticator.
      Returns:
      the scheme name, or null when this mechanism has no static OpenAPI representation
    • getOpenAPISecurityScheme

      default Map<String,Object> getOpenAPISecurityScheme()
      Returns an optional OpenAPI Security Scheme object for this authenticator. The returned map must contain only public scheme metadata and must never contain credentials or secret configuration.
      Returns:
      an OpenAPI Security Scheme object, or null when this mechanism has no static representation