Apache Sling Authentication Service

Clone this repo:
  1. c13923b fix(auth): sanitize redirect target in log messages to prevent log injection (#25) by Carsten Ziegeler · 6 weeks ago master
  2. 5e4a2a4 Add security section to AGENTS.md by Robert Munteanu · 6 weeks ago
  3. b8c881c docs: add AGENTS.md and update README with build and API notes (#26) by Carsten Ziegeler · 6 weeks ago
  4. 4ab40f1 chore: bump sling-bundle-parent to version 66 (#24) by Carsten Ziegeler · 3 months ago
  5. 530a1bc SLING-13025 Evaluate "resource" as fallback to "sling.auth.redirect" by Konrad Windszus · 7 months ago

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central auth License

Apache Sling Authentication Service

This module is part of the Apache Sling project.

The Sling Authentication Service bundle provides the basic mechanisms to authenticate HTTP requests with a JCR repository. Authentication detail extraction is extensible through the Authentication Handler SPI (AuthenticationHandler and JakartaAuthenticationHandler).

This module targets Java 17+ and OSGi Declarative Services (R7 annotations).

Installation

This bundle should be installed into an OSGi framework together with the Apache Sling Framework. Beyond Apache Sling it requires:

  • Apache Commons Codec 1.13+

Optional integrations (if available in the runtime):

  • Apache Sling Commons Metrics 1.2.8+
  • Apache Felix Health Check API 2.0.0+
  • Apache Sling JCR API 2.0.4+

Build

mvn package

Useful commands:

mvn test
mvn verify
mvn package -DskipTests
mvn clean package
mvn install

API and Runtime Notes

  • Supports both legacy javax.servlet (4.0.1) and Jakarta Servlet (jakarta.servlet 6.1.0) based authentication handlers.
  • Internal implementation classes live in org.apache.sling.auth.core.impl; public SPI is in org.apache.sling.auth.core.spi.
  • Metrics, health check, and some JCR-related packages are imported as optional OSGi dependencies.

Project Structure

pom.xml
bnd.bnd
src/
  main/java/org/apache/sling/auth/core/
    spi/
    impl/
      engine/
      hc/
  test/java/org/apache/sling/auth/core/