Simple OIDC authentication

1. Output of caddy version:

Not running yet

2. How I run Caddy:

Not running yet

a. System environment:

Linux + docker

b. Command:

Not running yet

c. Service/unit/compose file:

Not running yet

d. My complete Caddy config:

Not running yet

3. The problem I’m having:

Hi, all. What is the best way to achieve this scenario with caddy and its plugin ecosystem?

  1. Check incoming request.
  2. If not from certain IP, assert jwt from certain cookies
  3. If JWT is valid, continue processing the request to the next handler and ignore next step.
  4. If JWT is invalid, redirect to oidc provider authorization url.
  5. Upon succesful login with oidc and after being redirected back to caddy, set certain cookies with oidc access token (JWT)
  6. Redirect back to url visited in step 1

4. Error messages and/or full log output:

Not runnng yet

5. What I already tried:

Not running yet

6. Links to relevant resources:

You’re probably looking for this plugin:

1 Like

Hi @francislavoie , thanks for the link. I’ve read the doc but i can’t figure out how to skip the built-in ui of the authenticate plugin. Do you happen to know how to do it?

Open an issue on the plugin’s repo to ask for help; the developer will be able to help more effectively than I can.

1 Like

If you’re using caddy as a reverse proxy
add this between caddy and frontend/backends

works like a charm

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.