Skip to content

Commit

Permalink
Merge pull request #1758 from owncloud/remove-log-secrets
Browse files Browse the repository at this point in the history
remove JWT from logs
  • Loading branch information
C0rby authored Mar 3, 2021
2 parents 0719d18 + c532073 commit 57b3375
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/remove-log-secret.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ocis-pkg/middleware/openidconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func OpenIDConnect(opts ...ocisoidc.Option) func(http.Handler) http.Handler {
}
userInfo, err := oidcProvider.UserInfo(customCtx, oauth2.StaticTokenSource(oauth2Token))
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)
return
}
Expand Down
2 changes: 1 addition & 1 deletion proxy/pkg/middleware/oidc_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (m oidcAuth) getClaims(token string, req *http.Request) (claims oidc.Standa
oauth2.StaticTokenSource(oauth2Token),
)
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
return
}
Expand Down

0 comments on commit 57b3375

Please sign in to comment.