Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "idp/proxy: Match users by ID instead of name by default" #6420

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions changelog/3.0.0_2023-05-22/fix-idp-sub-recreation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ use the user's unique id (`owncloudUUID` by default) for computing the `sub`
claim. So that user's recreated with the same name will be treated as different
users by the IDP.

This changed also the default values of the 'PROXY_USER_OIDC_CLAIM' and
'PROXY_USER_CS3_CLAIM' settings map the IDP users to CS3 user by the userid in
the default setup. The old behavior of matching by username can be achieved
byt setting 'PROXY_USER_OIDC_CLAIM=preferred_username' and
'PROXY_USER_CS3_CLAIM=username'.

https://github.com/owncloud/ocis/issues/904
https://github.com/owncloud/ocis/pull/6326
https://github.com/owncloud/ocis/pull/6338
https://github.com/owncloud/ocis/pull/6420
1 change: 0 additions & 1 deletion services/idp/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ type Client struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Trusted bool `yaml:"trusted"`
ImplicitScopes []string `yaml:"implicit_scopes"`
Secret string `yaml:"secret"`
RedirectURIs []string `yaml:"redirect_uris"`
Origins []string `yaml:"origins"`
Expand Down
10 changes: 3 additions & 7 deletions services/idp/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ func DefaultConfig() *config.Config {
},
Clients: []config.Client{
{
ID: "web",
Name: "ownCloud Web app",
ImplicitScopes: []string{"LibgreGraph.UUID"},
Trusted: true,
ID: "web",
Name: "ownCloud Web app",
Trusted: true,
RedirectURIs: []string{
"{{OCIS_URL}}/",
"{{OCIS_URL}}/oidc-callback.html",
Expand All @@ -88,7 +87,6 @@ func DefaultConfig() *config.Config {
ID: "xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69",
Secret: "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh",
Name: "ownCloud desktop app",
ImplicitScopes: []string{"LibgreGraph.UUID"},
ApplicationType: "native",
RedirectURIs: []string{
"http://127.0.0.1",
Expand All @@ -99,7 +97,6 @@ func DefaultConfig() *config.Config {
ID: "e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD",
Secret: "dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD",
Name: "ownCloud Android app",
ImplicitScopes: []string{"LibgreGraph.UUID"},
ApplicationType: "native",
RedirectURIs: []string{
"oc://android.owncloud.com",
Expand All @@ -109,7 +106,6 @@ func DefaultConfig() *config.Config {
ID: "mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1",
Secret: "KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx",
Name: "ownCloud iOS app",
ImplicitScopes: []string{"LibgreGraph.UUID"},
ApplicationType: "native",
RedirectURIs: []string{
"oc://ios.owncloud.com",
Expand Down
6 changes: 2 additions & 4 deletions services/proxy/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,8 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config,
if cfg.EnableBasicAuth {
logger.Warn().Msg("basic auth enabled, use only for testing or development")
authenticators = append(authenticators, middleware.BasicAuthenticator{
Logger: logger,
UserProvider: userProvider,
UserCS3Claim: cfg.UserCS3Claim,
UserOIDCClaim: cfg.UserOIDCClaim,
Logger: logger,
UserProvider: userProvider,
})
}

Expand Down
4 changes: 2 additions & 2 deletions services/proxy/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ func DefaultConfig() *config.Config {
Enabled: true,
},
AccountBackend: "cs3",
UserOIDCClaim: "lg.uuid",
UserCS3Claim: "userid",
UserOIDCClaim: "preferred_username",
UserCS3Claim: "username",
AutoprovisionAccounts: false,
EnableBasicAuth: false,
InsecureBackends: false,
Expand Down