From bb62086fda692a0cc9277abe172e7cd03b0b9434 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Tue, 7 Jul 2026 20:52:49 +0200 Subject: [PATCH] fix: more oidc logging In debug mode this outputs the oidc discovery 2026-07-07T20:51:14+02:00 DBG discover config={"authorization_endpoint":"http://192.168.178.2:5556/dex/auth","claims_supported":["iss","sub","aud","iat","exp","email","email_verified","locale","name","preferred_username","at_hash"],"code_challenge_methods_supported":["S256","plain"],"device_authorization_endpoint":"http://192.168.178.2:5556/dex/device/code","grant_types_supported":["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code","urn:ietf:params:oauth:grant-type:token-exchange"],"id_token_signing_alg_values_supported":["RS256"],"introspection_endpoint":"http://192.168.178.2:5556/dex/token/introspect","issuer":"http://192.168.178.2:5556/dex","jwks_uri":"http://192.168.178.2:5556/dex/keys","request_uri_parameter_supported":false,"response_types_supported":["code"],"scopes_supported":["openid","email","groups","profile","offline_access"],"subject_types_supported":["public"],"token_endpoint":"http://192.168.178.2:5556/dex/token","token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post"],"userinfo_endpoint":"http://192.168.178.2:5556/dex/userinfo"} rp.function=NewRelyingPartyOIDC --- api/oidc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/oidc.go b/api/oidc.go index a62cfd3f..172ec705 100644 --- a/api/oidc.go +++ b/api/oidc.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "io" + "log/slog" "net/http" "net/url" "strings" @@ -18,6 +19,7 @@ import ( "github.com/gotify/server/v2/database" "github.com/gotify/server/v2/decaymap" "github.com/gotify/server/v2/model" + "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/zitadel/oidc/v3/pkg/client/rp" httphelper "github.com/zitadel/oidc/v3/pkg/http" @@ -39,6 +41,7 @@ func NewOIDC(conf *config.Configuration, db *database.GormDatabase, userChangeNo rp.WithCookieHandler(cookieHandler), rp.WithPKCE(cookieHandler), rp.WithSigningAlgsFromDiscovery(), + rp.WithLogger(slog.New(zerolog.NewSlogHandler(log.Logger))), } provider, err := rp.NewRelyingPartyOIDC(