1.5.0 โ€ข Published 4 months ago

@aaroncadillac/oidc-reverse-proxy v1.5.0

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
4 months ago

oidc-rproxy CLI

oidc-rproxy is a command-line tool for launching a reverse proxy protected with OpenID Connect (OIDC). It uses a JSON config file and supports environment variables.


๐Ÿ“ฆ Installation

npm install -g @aaroncadillac/oidc-reverse-proxy

๐Ÿš€ Basic Usage

oidc-rproxy run

This command starts the OIDC-authenticated reverse proxy server. Optionally, you can customize the host, port, and config file path:

oidc-rproxy run --host 0.0.0.0 --port 8080 --config ~/custom-config.json

๐Ÿงพ Commands

run

Starts the reverse proxy server.

Global Options

OptionDescriptionDefault value
--host, -h$OIDC_RPROXY_HOST Host to bindlocalhost
--port, -p$OIDC_RPROXY_PORT Port to listen on3000
--config, -cPath to the JSON config file~/oidc-rproxy.json

Examples

oidc-rproxy run
oidc-rproxy run --host 127.0.0.1 --port 9000 --config ~/config.json

โš™๏ธ Configuration File (oidc-rproxy.json)

The config file is a JSON file that defines how users are authenticated and how requests are routed to backend services.

๐Ÿ“ Expected Schema

{
  "issuer": "https://auth.example.com",
  "client_id": "my-client-id",
  "client_secret": "my-client-secret",
  "authorization_endpoint": "https://auth.example.com/oauth2/authorize",
  "token_endpoint": "https://auth.example.com/oauth2/token",
  "user_info_endpoint": "https://auth.example.com/oauth2/userinfo",
  "on_unauthenticated_request": "redirect", // or "deny"
  "scope": "openid email profile",
  "session_cookie_name": "oidc_session",
  "email_domains": ["example.com", "anotherdomain.com"],
  "paths": {
    "/foo/": {
      "upstream": "http://127.0.0.1:9003"
    },
    "/bar/": {
      "upstream": "http://localhost:5000",
      "healthcheck": "health"
    }
  }
}

๐Ÿ“ Notes

paths keys must end with /

๐Ÿงช Required Fields

  • issuer
  • client_id
  • client_secret
  • authorization_endpoint
  • token_endpoint
  • user_info_endpoint
  • paths
  • paths.*.upstream

๐Ÿ” Authentication

  • Only users authenticated via OIDC will be allowed.
  • You can restrict access to specific email domains using the email_domains array.
1.5.0

4 months ago

1.4.0

4 months ago

1.3.1

4 months ago

1.3.0

4 months ago

1.2.0

4 months ago

1.1.2

4 months ago

1.1.1

4 months ago

1.1.0

4 months ago