project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Bug] configuring OIDC with Authentik

Open IMNotMax opened this issue 8 months ago • 23 comments

Describe the bug

Issue with OIDC and Authentik since last 2 updates I think (did not keep tracks of the working versions)

When I first set up OIDC with Authentik, I found 2 issues :

  1. the callback URL is https://pegaprox.domain.tld/oidc/callback and not https://pegaprox.domain.tld/api/auth/oidc/callback as seen in the documentation (I've updated the Bug #153 )
  2. the Test does not pass for Authorization Endpoint (HTTP 404)
Image

BUT despite these issues, the OIDC was working

Today

OIDC does not work anymore.

  1. with the call back URL (as documented) https://pegaprox.domain.tld/api/auth/oidc/callback the browser shows :
Error 405 Method Not Allowed

The method is not allowed for the requested URL.

juste after authenticating with Authentik

  1. with the callback URL https://pegaprox.domain.tld/oidc/callback

Token validation error

Image

FYI :

  • I changed the callback URL in Authentik and in Pegaprox to test this behavior.
  • I've created a user in Pegaprox to fit with the user I use in Authentik (everywhere in my homelab - and the config in authentik is mainly the same for every platform using OIDC) AND I used to be able to connect with it
  • I log out from everything, clear the cache, change the browser even (Safari and Chrome tested)

Steps to Reproduce

  1. Configure Authentik
  2. Change the settings to configure OIDC
Image
  1. Test the OIDC config
  2. try to log in

Expected behavior

Can use the OIDC to log in Pegaprox

Environment

  • PegaProx Version: Beta 0.9.2
  • Installation Method: with curl -sSL https://raw.githubusercontent.com/PegaProx/project-pegaprox/refs/heads/main/deploy.sh | bash
  • OS: debian 13
  • Browser: Safari (26.3.1) and Vivaldi (7.8.3925.81 (Version officielle) (arm64))
  • Behind Reverse Proxy? Nginx Proxy Manager
  • Authentik Version 2025.12.1

Logs

Did not find relevant logs, only this kind :

  {
    "timestamp": "2026-03-17T21:45:30.182743",
    "user": "pegaprox",
    "action": "settings.oidc",
    "details": "OIDC settings updated (enabled=True, provider=generic)",
    "ip": "::ffff:192..."
  },

How to have more detailed logs ?

Screenshots

Checklist

  • [x] I have searched existing issues to make sure this is not a duplicate
  • [x] I am using the latest version of PegaProx

IMNotMax avatar Mar 18 '26 03:03 IMNotMax

Hi @IMNotMax ,

I think I know actually what this causes we added here a oidc validator in the 0.9.2 that seems not to like the token

MrMasterbay avatar Mar 18 '26 07:03 MrMasterbay

Hi @IMNotMax ,

can you check with the latest update if that is still appearing?

Regards, Nico

MrMasterbay avatar Mar 20 '26 17:03 MrMasterbay

Sadly, still not working (sorry all screen shots below are in French, I'm looking for improvement of the translation if needed)

I add some screenshots I took rapidly . maybe you'll see issues in my config (never underestimate the 'unpredictable thing' between the chair and the keyboard !)

Image Image Image Image

IMNotMax avatar Mar 20 '26 18:03 IMNotMax

Hi @IMNotMax ,

sorry to keep annoy you but could you try it with the 0.9.3 again?

MrMasterbay avatar Mar 23 '26 22:03 MrMasterbay

Will test! No problem, if it helps :)

IMNotMax avatar Mar 23 '26 22:03 IMNotMax

@IMNotMax That helps a lot thx! :)

MrMasterbay avatar Mar 24 '26 22:03 MrMasterbay

Hi there,

TL;DR : Sorry did not work

Same config. Still HTTP 404 :

Image

I,ve created my user (with the same email address) in Pegaprox and in Authentik (already tested without user created AND option to create user activated) (Spoiler alet, I am Max :P ) Image

Sign In with Authentik hit, Authentik made me authenticate correctly, return on the pegaprox page with :

Image

IMNotMax avatar Mar 25 '26 01:03 IMNotMax

Will be happy to help for testing or sharing logs (not publicly because the domain.tld could be exposed on the internet) If you want logs, explain how to get these logs (journalct or specific files, only the zip bundle ?) and I should fin a way to share it with you.

IMNotMax avatar Mar 25 '26 01:03 IMNotMax

Hi, this error message is new. just appears once.

Image

IMNotMax avatar Mar 26 '26 01:03 IMNotMax

Hi @IMNotMax ,

this is indeed a stranger behavior there. @Mrmasterbay can you take a look?

mkellermann97 avatar Mar 26 '26 05:03 mkellermann97

not able to reproduce this error. maybe a glitch, no more than that.

What I don't understand is why Pegaprox cannot use Authentik with a really similar config than a lot of tools I use. And why it used to work :) Is the OIDC validator mandatory ?

IMNotMax avatar Mar 26 '26 13:03 IMNotMax

Hi @IMNotMax ,

We've added now that the validator can be turned off. And indeed as we are also in "High Secure" Environments (Gov, Law Enforcement etc...) this is was a quite crucial request that we had.

Regards, Nico

MrMasterbay avatar Mar 29 '26 22:03 MrMasterbay

I hope this works again?

If not just mention me with @MrMasterbay and I will reopen it again :)

MrMasterbay avatar Apr 02 '26 19:04 MrMasterbay

Hi @MrMasterbay ,

Sorry to bother...

with PegaProx Beta 0.9.4.1 I still have issues.

I can disable JWT Signature Verification, save OIDC Settings. looks good BUT if I log out and log in with password (n to with OIDC, the JWT Signature Verification is back to enable (no persistance)

Image

And of course, if I try to log in with OIDC :

Image

IMNotMax avatar Apr 04 '26 00:04 IMNotMax

Hi @IMNotMax sorry for that.

Should be now fixed :)

MrMasterbay avatar Apr 07 '26 07:04 MrMasterbay

No luck for me... Same issue even with the persistance of the check ton disable JWT Signature Verification. same error message on OIDC login

Image

I really think it's due to the Authorization Endpoint: HTTP 404 error when I test the OIDC configuration. Don't know how you test the endpoint, and really don't understand what is so different with Authentik.

If you have any idea, I can run tests.

IMNotMax avatar Apr 08 '26 02:04 IMNotMax

I’m still seeing this issue on 0.9.5 when using Authentik as a Generic OIDC provider.

I might be misunderstanding something, but it looks like PegaProx is building the authorization endpoint from the issuer instead of using the discovery document.

Here’s what Authentik returns:

{
  "issuer": "https://auth.example.com/application/o/pegaprox/",
  "authorization_endpoint": "https://auth.example.com/application/o/authorize/",
  "token_endpoint": "https://auth.example.com/application/o/token/",
  "jwks_uri": "https://auth.example.com/application/o/pegaprox/jwks/"
}

What I’m seeing in PegaProx:

  • JWKS check passes
  • Authorization endpoint check fails (404)

Testing manually:

curl -I https://auth.example.com/application/o/pegaprox/jwks/        # 200
curl -I https://auth.example.com/application/o/pegaprox/authorize/   # 404
curl -I https://auth.example.com/application/o/authorize/            # valid

So it seems like PegaProx is trying:

<issuer>/authorize/

instead of using the authorization_endpoint from discovery.

If that’s expected behavior, let me know — but it looks like this breaks compatibility with Authentik unless you add a proxy rewrite.

Happy to test anything if there’s a fix or workaround I missed.

kgarz avatar Apr 09 '26 18:04 kgarz

Oh! Great this could explain why I still have the issue with 0.95

IMNotMax avatar Apr 09 '26 19:04 IMNotMax

Hello @MrMasterbay, could you look at @kgarz solution just above here ⏫

IMNotMax avatar Apr 19 '26 01:04 IMNotMax

I have the same 404 error with authentik :-( Will there be a fix?

gerwin221 avatar Apr 24 '26 20:04 gerwin221