Custom Http

This page described configuring Lenses with a custom HTTP implementation for authentication.

With custom authentication, you can plug in your own authentication system by using HTTP headers.

In this approach, your own authentication proxy/code sitting in front of Lenses takes care of the authentication and injects appropriate Headers in all HTTP requests for verified users.

Setup a custom authentication layer

Set up a custom authentication layer by introducing in security.conf:

# Full classpath of customer authentication plugin
lenses.security.plugin=com.mycompany.authentication.plugin.class.path

Lenses connects similarly to any other application to the infrastructure You can implement a plugin in a few hours in Java/Scala or other JVM technology by implementing one interface:

public interface HttpAuthenticationPlugin {
    UserAndGroups authenticate(HttpRequest request);
}

The returned object UserAndGroups will contain the username and the groups a person authentication belongs to (or raise an exception if no such user exists).

Example

The best way to get started is to look into a sample open-source implementation of such a plugin in GitHub.

Last updated

Logo

2024 © Lenses.io Ltd. Apache, Apache Kafka, Kafka and associated open source project names are trademarks of the Apache Software Foundation.