The Simplest Way to Make Caddy and Ping Identity Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use caddy and ping identity to protect web apps with single sign-on. Caddy routes incoming web traffic while Ping Identity checks user logins and roles. This setup lets your team manage user rules in one central place. Caddy handles web certificates on its own, and Ping Identity manages user groups. Together, they keep unauthorized users out of your internal tools and dashboards. How caddy and ping identity share login data A user starts by opening a web app hosted behind a Caddy serve

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use caddy and ping identity to protect web apps with single sign-on. Caddy routes incoming web traffic while Ping Identity checks user logins and roles.

This setup lets your team manage user rules in one central place. Caddy handles web certificates on its own, and Ping Identity manages user groups. Together, they keep unauthorized users out of your internal tools and dashboards.

How caddy and ping identity share login data

A user starts by opening a web app hosted behind a Caddy server. Caddy sees that the user does not have an active login session yet. It pauses the web request and sends the browser over to Ping Identity.

Ping Identity asks the user to log in and complete a multi-factor check. Once the check passes, Ping Identity checks which groups the user belongs to. It then builds a signed token that holds the user email and role.

The browser carries this signed token back to the Caddy web server. An auth plugin inside Caddy checks the digital signature against Ping Identity keys. If the signature matches, Caddy reads the user role from the token data.

Caddy then passes the request to the backend app with clean user headers. The backend app reads those headers to see who is making the request. You do not need to write custom login code inside every single app.

Common mistakes when linking web servers and identity tools

Many teams set up broad token scopes that let any logged-in user enter. If you do not check group roles, any staff member can open admin tools. You must set Caddy rules to match specific Ping Identity groups per route.

Shared service accounts also create big security gaps between these two systems. When teams use one static key for all apps, they lose clear audit trails. If an attacker steals that single key, they can reach every web route. Give each Caddy instance its own client ID inside Ping Identity instead.

Ping Identity + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common risk comes from open network paths behind the web server. Sometimes engineers leave the backend app port open to the whole local network. Users can then skip Caddy and open the backend app without logging in. Lock down the backend firewall so it only accepts traffic from Caddy.

Long token lifetimes also cause trouble when someone leaves your company. If a session lasts for days, a removed user keeps their access too long. Set short token timers in Ping Identity so Caddy checks user status often.

Scoping roles and network paths for safer access

Start by creating clear user groups inside your Ping Identity admin console. Map each group to a single job duty, like billing support or database admin. Only send the exact group names that Caddy needs inside the login token.

Next, set up Caddy to reject any token that lacks the right group. Keep your web server rules simple and tie each URL path to one role. Log every login check so your security team can review failed attempts later.

Finally, protect the network path between Caddy and your internal backend services. Use encrypted links even when traffic moves inside your own private cloud network. Rotate your Ping Identity client keys on a set schedule to limit risk.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Does Caddy support Ping Identity out of the box?

Standard Caddy needs an extra auth plugin to run OpenID Connect login flows. Once you add a compatible security module, it connects to Ping Identity using standard web protocols.

How do I pass user roles from Ping Identity to my app?

Set Ping Identity to include group claims inside the user token at login. Caddy reads those claims and forwards them to your backend app as HTTP headers.

What happens when a user session expires in Caddy?

Caddy rejects the expired cookie and sends the user back to Ping Identity. If the user still has an active Ping Identity session, they get a new token right away.

The query runs. The emails stay hidden.