fix(oidc): show detailed error reasons (#3175)

pull/3174/head
James Elliott 2022-04-12 21:39:15 +10:00 committed by GitHub
parent 85a88de24d
commit f97474f01b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ func OAuthIntrospectionPOST(ctx *middlewares.AutheliaCtx, rw http.ResponseWriter
if responder, err = ctx.Providers.OpenIDConnect.Fosite.NewIntrospectionRequest(ctx, req, oidcSession); err != nil { if responder, err = ctx.Providers.OpenIDConnect.Fosite.NewIntrospectionRequest(ctx, req, oidcSession); err != nil {
rfc := fosite.ErrorToRFC6749Error(err) rfc := fosite.ErrorToRFC6749Error(err)
ctx.Logger.Errorf("Introspection Request failed with error: %+v", rfc) ctx.Logger.Errorf("Introspection Request failed with error: %s", rfc.GetDescription())
ctx.Providers.OpenIDConnect.Fosite.WriteIntrospectionError(rw, err) ctx.Providers.OpenIDConnect.Fosite.WriteIntrospectionError(rw, err)

View File

@ -17,7 +17,7 @@ func OAuthRevocationPOST(ctx *middlewares.AutheliaCtx, rw http.ResponseWriter, r
if err = ctx.Providers.OpenIDConnect.Fosite.NewRevocationRequest(ctx, req); err != nil { if err = ctx.Providers.OpenIDConnect.Fosite.NewRevocationRequest(ctx, req); err != nil {
rfc := fosite.ErrorToRFC6749Error(err) rfc := fosite.ErrorToRFC6749Error(err)
ctx.Logger.Errorf("Revocation Request failed with error: %+v", rfc) ctx.Logger.Errorf("Revocation Request failed with error: %s", rfc.GetDescription())
} }
ctx.Providers.OpenIDConnect.Fosite.WriteRevocationResponse(rw, err) ctx.Providers.OpenIDConnect.Fosite.WriteRevocationResponse(rw, err)

View File

@ -29,7 +29,7 @@ func OpenIDConnectAuthorizationGET(ctx *middlewares.AutheliaCtx, rw http.Respons
if requester, err = ctx.Providers.OpenIDConnect.Fosite.NewAuthorizeRequest(ctx, r); err != nil { if requester, err = ctx.Providers.OpenIDConnect.Fosite.NewAuthorizeRequest(ctx, r); err != nil {
rfc := fosite.ErrorToRFC6749Error(err) rfc := fosite.ErrorToRFC6749Error(err)
ctx.Logger.Errorf("Authorization Request failed with error: %+v", rfc) ctx.Logger.Errorf("Authorization Request failed with error: %s", rfc.GetDescription())
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw, requester, err) ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw, requester, err)
@ -104,7 +104,7 @@ func OpenIDConnectAuthorizationGET(ctx *middlewares.AutheliaCtx, rw http.Respons
if responder, err = ctx.Providers.OpenIDConnect.Fosite.NewAuthorizeResponse(ctx, requester, oidcSession); err != nil { if responder, err = ctx.Providers.OpenIDConnect.Fosite.NewAuthorizeResponse(ctx, requester, oidcSession); err != nil {
rfc := fosite.ErrorToRFC6749Error(err) rfc := fosite.ErrorToRFC6749Error(err)
ctx.Logger.Errorf("Authorization Response for Request with id '%s' on client with id '%s' could not be created: %+v", requester.GetID(), clientID, rfc) ctx.Logger.Errorf("Authorization Response for Request with id '%s' on client with id '%s' could not be created: %s", requester.GetID(), clientID, rfc.GetDescription())
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw, requester, err) ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw, requester, err)

View File

@ -24,7 +24,7 @@ func OpenIDConnectTokenPOST(ctx *middlewares.AutheliaCtx, rw http.ResponseWriter
if requester, err = ctx.Providers.OpenIDConnect.Fosite.NewAccessRequest(ctx, req, oidcSession); err != nil { if requester, err = ctx.Providers.OpenIDConnect.Fosite.NewAccessRequest(ctx, req, oidcSession); err != nil {
rfc := fosite.ErrorToRFC6749Error(err) rfc := fosite.ErrorToRFC6749Error(err)
ctx.Logger.Errorf("Access Request failed with error: %+v", rfc) ctx.Logger.Errorf("Access Request failed with error: %s", rfc.GetDescription())
ctx.Providers.OpenIDConnect.Fosite.WriteAccessError(rw, requester, err) ctx.Providers.OpenIDConnect.Fosite.WriteAccessError(rw, requester, err)
@ -47,7 +47,7 @@ func OpenIDConnectTokenPOST(ctx *middlewares.AutheliaCtx, rw http.ResponseWriter
if responder, err = ctx.Providers.OpenIDConnect.Fosite.NewAccessResponse(ctx, requester); err != nil { if responder, err = ctx.Providers.OpenIDConnect.Fosite.NewAccessResponse(ctx, requester); err != nil {
rfc := fosite.ErrorToRFC6749Error(err) rfc := fosite.ErrorToRFC6749Error(err)
ctx.Logger.Errorf("Access Response for Request with id '%s' failed to be created with error: %+v", requester.GetID(), rfc) ctx.Logger.Errorf("Access Response for Request with id '%s' failed to be created with error: %s", requester.GetID(), rfc.GetDescription())
ctx.Providers.OpenIDConnect.Fosite.WriteAccessError(rw, requester, err) ctx.Providers.OpenIDConnect.Fosite.WriteAccessError(rw, requester, err)