Skip to main content
Version: 0.9.x

Authentication Mechanism

Overview

The Authentication Mechanism serves as a safeguard for your company's sensitive information, allowing for the dynamic adjustment of authentication requests by injecting the necessary values without exposing them within your clients' applications. This ensures enhanced control over your organization's secrets.

Here's an explanation of the available configuration options for different authentication types:

Basic: The Basic configuration is designed to modify the "Authorization" header key by employing base64 encoding, as it's expected to be generated. This configuration allows you to specify the username and password values for this type of authentication.

OAuth: OAuth configuration enables you to make adjustments to keys and values within request bodies. With this configuration, you can define OAuth tokens, including their names and values.

API KEY: The API KEY configuration allows you to modify header keys and values for authentication requests. This configuration lets you specify the API key's name (usually associated with a user) and its corresponding value (the secret key or password).

Configuration

/etc/lunar-proxy/policies.yaml
endpoints:
- url: "api.com/login"
method: "GET"
remedies:
- enabled: true
name: "AuthManagement"
config:
authentication:
account: "auth_3" # The type of authentication to apply

accounts:
auth_3:
authentication:
basic:
username: "user1"
password: "password1"

auth_4:
authentication:
o_auth:
tokens:
- name: ${{O_AUTH_SECRET_KEY}} # This configuration allows users to load values from the environment variables.
value: ${{O_AUTH_SECRET_VALUE}}
- name: ${{O_AUTH_SECRET_KEY2}}
value: ${{O_AUTH_SECRET_VALUE2}}
auth_5:
authentication:
api_key:
tokens:
- name: "user1"
value: "password1"
- name: "user2"
value: "password2"

Why use Authentication Mechanism plugin?

Using this authentication mechanism offers several compelling advantages:

  1. Enhanced Security: It dynamically modifies authentication requests, reducing the exposure of sensitive information and mitigating the risk of data breaches.
  2. Secret Protection: Your company's crucial secrets, including API keys and credentials, remain shielded from direct exposure in client applications.
  3. Scalability: As your organization expands, it effortlessly scales to accommodate new APIs and services without imposing significant overhead.
  4. Reduced Developer Overhead: Developers can concentrate on building core functionality instead of managing intricate authentication details, accelerating development cycles.
Click me for guidance 😀