remove JWT from logs
secrets should not be exposed in the logs
This commit is contained in:
3 files changed
+7
-2
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
Enhancement: Remove the JWT from the log
|
||||||
|
|
||||||
|
We were logging the JWT in some places. Secrets should not be exposed in logs so it got removed.
|
||||||
|
|
||||||
|
https://github.com/owncloud/ocis/pull/1758
|
||||||
@@ -85,7 +85,7 @@ func OpenIDConnect(opts ...ocisoidc.Option) func(http.Handler) http.Handler {
|
|||||||
}
|
}
|
||||||
userInfo, err := oidcProvider.UserInfo(customCtx, oauth2.StaticTokenSource(oauth2Token))
|
userInfo, err := oidcProvider.UserInfo(customCtx, oauth2.StaticTokenSource(oauth2Token))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
opt.Logger.Error().Err(err).Str("token", string(token)).Msg("Failed to get userinfo")
|
opt.Logger.Error().Err(err).Msg("Failed to get userinfo")
|
||||||
http.Error(w, ErrInvalidToken.Error(), http.StatusUnauthorized)
|
http.Error(w, ErrInvalidToken.Error(), http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ func (m oidcAuth) getClaims(token string, req *http.Request) (claims oidc.Standa
|
|||||||
oauth2.StaticTokenSource(oauth2Token),
|
oauth2.StaticTokenSource(oauth2Token),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
m.logger.Error().Err(err).Str("token", token).Msg("Failed to get userinfo")
|
m.logger.Error().Err(err).Msg("Failed to get userinfo")
|
||||||
status = http.StatusUnauthorized
|
status = http.StatusUnauthorized
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user