mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-03 06:27:17 -05:00
fix basic auth with custom user claim
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Bugfix: Fix basic auth with custom user claim
|
||||
|
||||
We've fixed authentication with basic if oCIS is configured to use a non-standard claim
|
||||
as user claim (`PROXY_USER_OIDC_CLAIM`). Prior to this bugfix the authentication always
|
||||
failed and is now working.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/2755
|
||||
@@ -220,6 +220,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config)
|
||||
middleware.EnableBasicAuth(cfg.EnableBasicAuth),
|
||||
middleware.UserProvider(userProvider),
|
||||
middleware.OIDCIss(cfg.OIDC.Issuer),
|
||||
middleware.UserOIDCClaim(cfg.UserOIDCClaim),
|
||||
middleware.CredentialsByUserAgent(cfg.Reva.Middleware.Auth.CredentialsByUserAgent),
|
||||
),
|
||||
middleware.SignedURLAuth(
|
||||
|
||||
@@ -126,6 +126,7 @@ func newBasicAuth(options Options) func(http.Handler) http.Handler {
|
||||
EnableBasicAuth(options.EnableBasicAuth),
|
||||
AccountsClient(options.AccountsClient),
|
||||
OIDCIss(options.OIDCIss),
|
||||
UserOIDCClaim(options.UserOIDCClaim),
|
||||
CredentialsByUserAgent(options.CredentialsByUserAgent),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ func BasicAuth(optionSetters ...Option) func(next http.Handler) http.Handler {
|
||||
// fake oidc claims
|
||||
claims := map[string]interface{}{
|
||||
oidc.OwncloudUUID: user.Id.OpaqueId,
|
||||
options.UserOIDCClaim: user.Id.OpaqueId,
|
||||
oidc.Iss: user.Id.Idp,
|
||||
oidc.PreferredUsername: user.Username,
|
||||
oidc.Email: user.Mail,
|
||||
|
||||
Reference in New Issue
Block a user