Implementing External Authentication in Pangolin Using OIDC (PocketId)

Pangolin now supports external identity providers using OAuth2/OIDC. This powerful feature allows Pangolin to act as a full authentication proxy and replace both Pangolin’s own login system and protect downstream services that don’t natively support SSO. In this guide, we’ll demonstrate how to use PocketId as your identity provider. PocketId is a simple but powerful OIDC Provider for SSO with Passkeys.


:page_facing_up: Prerequisites

  • A working Pangolin setup (v1.3.0 or later)
  • A domain name with DNS pointing to your Pangolin server (e.g., pangolin.yourdomain.com)
  • A PocketId server deployed and accessible over HTTPS. Note, you can follow our guide on Using AWS CloudFormation to Create Test Authentication Servers to quickly deploy PocketID.

:rocket: Step 1: Upgrade Pangolin

Ensure you are running at least version 1.3.0.

Update your Docker Compose:

services:
  pangolin:
    image: fosrl/pangolin:1.3.0
    container_name: pangolin
    restart: unless-stopped
    volumes:
      - ./config:/app/config
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3001/api/v1/"]
      interval: "3s"
      timeout: "3s"
      retries: 5

Restart your containers:

docker compose down
docker compose up -d

:key: Step 2: Set Up PocketId as OIDC Provider

  1. Log into your PocketId dashboard.

  2. Go to OIDC Clients and create a new one.

  3. Set the callback URL to:

    https://*.yourdomain.com/auth/idp/2/oidc/callback
    

  1. After creating the OIDC configuration, retrieve the Client ID and Client Secret.


:brain: Step 3: Create Identity Provider in Pangolin

  1. In Pangolin, go to Server Admin > Identity Providers

  2. Click Create Identity Provider

  3. Fill in the following:

    • Name: PocketId
    • Client ID / Secret: from PocketId
    • Authorization URL: https://<your-pocketid-domain>/oidc/auth
    • Token URL: https://<your-pocketid-domain>/oidc/token
    • Identifier Path: preferred_username

Click Create Identity Provider. You’ll receive a Redirect URI to add to your PocketId configuration if needed.


:bust_in_silhouette: Step 4: Add a PocketId User in Pangolin

  1. Go to Organization > Access Control
  2. Then Users
  3. Click Create User, select External User
  4. Under Identity Provider, choose PocketId
  5. Set the Username to the email or ID used in PocketId


:gear: Step 5: Test with a Sample Web App

5.1 Start a Simple HTTP Server

  python-http:
    image: python:3.11-slim
    container_name: python-http
    working_dir: /app
    command: python -m http.server 15000
    ports:
      - "15000:15000"
    restart: unless-stopped

Start it:

docker compose up -d

5.2 Create a Resource in Pangolin

  1. Go to Resources in Pangolin

  2. Click Create Resource

  3. Use:

    • Name: local-http
    • URL: https://local-http.yourdomain.com
    • Host: python-http
    • Port: 15000

5.3 Assign Role to User

  1. Go to the created resource
  2. Add the external user you created and assign them a role (e.g., member)


:test_tube: Step 6: Log In and Test

  1. Open a new Incognito window

  2. Visit:

    https://local-http.yourdomain.com
    
  3. You should see the Pangolin login page with PocketId as a login option

Click the PocketId button, sign in, and return to the HTTP page.


:hammer_and_wrench: Step 7: Troubleshooting

Redirect URI mismatch:

  • Ensure PocketId allows wildcard callback URLs or has the exact redirect URI

User not authorized:

  • Check the user is provisioned and has the correct role in Pangolin

No login button shows:

  • Confirm the Identity Provider is enabled and correctly linked

:white_check_mark: Summary

In this guide, we showed how to set up PocketId as an external OIDC identity provider for Pangolin. This provides a fully working, modern authentication flow to protect services with minimal configuration.


:folded_hands: Thank You

Thanks for following along! External OIDC integration is a powerful step toward building secure, flexible infrastructure with Pangolin. Try using PocketId alongside other supported providers like Authelia or Authentik, and explore more with Middleware Manager.

Happy authenticating! :rocket:

4 Likes

Nice tutorial, it works with pangolin . Thanks.

I want to configure Headscale so that I can use Pocket ID to log in. I used this tutorial to install Pangolin and Headscale. Integrating Headscale and Headplane with Pangolin Unfortunately, I can’t get Pocket ID and Headscale to work together. Do you have any ideas?

1 Like

Sorry I am not familiar with headscale

1 Like