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

OIDC callback fails with TypeError: oidc_decode_id_token() got an unexpected keyword argument 'config'

Open KiruaZ opened this issue 9 months ago • 2 comments

Bug Description

OIDC authentication fails during the callback phase. The token exchange with the IdP succeeds (HTTP 200), but PegaProx crashes when decoding the ID token.

Error

Exception on /api/auth/oidc/callback [POST]
  File "/app/pegaprox/api/auth.py", line 155, in oidc_callback
    id_claims = oidc_decode_id_token(id_token_raw, expected_nonce=stored_nonce, config=config)
TypeError: oidc_decode_id_token() got an unexpected keyword argument 'config'

Root Cause

In api/auth.py line 155, oidc_decode_id_token() is called with config=config, but the function signature in utils/oidc.py line 227 doesn't accept it:

# auth.py (call)
id_claims = oidc_decode_id_token(id_token_raw, expected_nonce=stored_nonce, config=config)

# oidc.py (definition)
def oidc_decode_id_token(id_token: str, expected_nonce: str = None) -> dict:

Fix

Remove config=config from the call:

id_claims = oidc_decode_id_token(id_token_raw, expected_nonce=stored_nonce)

Environment

  • PegaProx: built from main branch (March 2026)
  • Python: 3.12
  • IdP: Authentik (OAuth2/OIDC)
  • Scopes: openid profile email

KiruaZ avatar Mar 03 '26 17:03 KiruaZ

Hi @KiruaZ ,

Funny timing – I actually came across this two days ago and already had a commit mostly ready. Then I saw you opened a ticket for it :) Just pushed the fix, it'll be included in tomorrow's update.

Regards, Marcus

mkellermann97 avatar Mar 03 '26 19:03 mkellermann97

Hi @KiruaZ ,

please update to the latest version. Best Regards, Nico

MrMasterbay avatar Mar 04 '26 19:03 MrMasterbay