You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Different accounts may use same keychain entry #5830
Currently the client saves and looks up keychain entries by user + server url. This leads to problems when there are several accounts with the same identifier.
Specifics:
Deleting one of the accounts will wipe the keychain entries, making the second one unusable.
If the two accounts use different auth mechanisms (oauth2 vs http), the keychain entries get overwritten with different data.
An account should generate an additional unique identifier to disambiguate the different accounts. Care needs to be taken to make it backwards compatible.
If the two accounts use different auth mechanisms (oauth2 vs http), the keychain entries get overwritten with different data.
That's not possible, the client uses oauth2 always if the server supports it. Even if the account was configured with basic http auth before, it will then switch to oauth2 on the next connection.
@ogoffart Then there's some other bug lurking there, because I set up a new oauth2 account. Restarted the client and one of the two accounts pointing to the same server was signed out for no apparent reason. I guessed that the http-account's persist() overwrote some oauth keychain data...
An account should generate an additional unique identifier to disambiguate the different accounts. Care needs to be taken to make it backwards compatible.
Remember that this might be a quite exotic setup, so don't introduce too much complexity for this.
Maybe WONTFIX? Or whatever @ogoffart says?
Can be exotic yup, but if allowed (#5305) I think it should be done with unique account id's since otherwise it may have collateral effects for the people that use the client in that way (having the same account multiple times) 🤔
@guruz I think that if it's a supported feature we should care about the related bugs (but not with high priority since few people see it). If we don't want to support these setups altogether we should remove the ability to create multiple accounts for the same server in the first place.
What should happen (not tested, because the oauth2 app currently does not allow several connections) is that one of the account connects and the other re open the browser. Not too bad.
If we change the way we store in the keychain then we need an upgrade path.
And does having twice the same account make any sense?
because the oauth2 app currently does not allow several connections
but it will..
If we change the way we store in the keychain then we need an upgrade path.
ack
And does having twice the same account make any sense?
Yes, we had agreed that this shall be possible because users are doing things we don't imagine (e.g. they sync the same account to both their HD and a USB drive)
I'm also doing this for testing scenarios.
Another issue with current implementation: after #5752 removing an account could have the collateral of login out the other one when the client is restarted.
Activity
ogoffart commentedon Jun 12, 2017
That's not possible, the client uses oauth2 always if the server supports it. Even if the account was configured with basic http auth before, it will then switch to oauth2 on the next connection.
SamuAlfageme commentedon Jun 12, 2017
Related behavior for the cookies on log out/account removal: #5383 (comment)
ckamm commentedon Jun 12, 2017
@ogoffart Then there's some other bug lurking there, because I set up a new oauth2 account. Restarted the client and one of the two accounts pointing to the same server was signed out for no apparent reason. I guessed that the http-account's persist() overwrote some oauth keychain data...
guruz commentedon Jun 12, 2017
Remember that this might be a quite exotic setup, so don't introduce too much complexity for this.
Maybe WONTFIX? Or whatever @ogoffart says?
SamuAlfageme commentedon Jun 13, 2017
Couldn't we simply use the id from the
.cfgfile also to reference the accounts on the keychain, etc... (i.e. the N inN\config_key=config_value)Can be exotic yup, but if allowed (#5305) I think it should be done with unique account id's since otherwise it may have collateral effects for the people that use the client in that way (having the same account multiple times) 🤔
ckamm commentedon Jun 13, 2017
@guruz I think that if it's a supported feature we should care about the related bugs (but not with high priority since few people see it). If we don't want to support these setups altogether we should remove the ability to create multiple accounts for the same server in the first place.
phil-davis commentedon Jun 13, 2017
Just checking that here you mean some sort of "weird" setup where someone adds the same account on the same server multiple times.
Having multiple different accounts set up on the client that are all on the same server works fine, and is a reasonable thing to do (well, I do it)
ckamm commentedon Jun 14, 2017
@phil-davis Yes, thanks for the clarification. I meant several accounts pointing to the same user on the same server.
ogoffart commentedon Jul 21, 2017
This might actually be a problem for oauth where the refresh_token can only be used once.
guruz commentedon Jul 21, 2017
Upgraded to p2.
Gold ticket?
ogoffart commentedon Jul 21, 2017
What should happen (not tested, because the oauth2 app currently does not allow several connections) is that one of the account connects and the other re open the browser. Not too bad.
If we change the way we store in the keychain then we need an upgrade path.
And does having twice the same account make any sense?
guruz commentedon Jul 25, 2017
but it will..
ack
Yes, we had agreed that this shall be possible because users are doing things we don't imagine (e.g. they sync the same account to both their HD and a USB drive)
I'm also doing this for testing scenarios.
ogoffart commentedon Jul 28, 2017
Tested with owncloud/oauth2#65 and everything works perfectly as we can re-use the refresh_token several time.
SamuAlfageme commentedon Aug 1, 2017
Pointed out in owncloud/oauth2#70 since that should be solved in the future and we might need to adapt to get a deterministic behavior.
SamuAlfageme commentedon Aug 10, 2017
Another issue with current implementation: after #5752 removing an account could have the collateral of login out the other one when the client is restarted.
ckamm commentedon Sep 12, 2017
It's a bit painful due to migration, but I can take care of it.
Credentials: Use per-account keychain entries #5830
Credentials: Use per-account keychain entries #5830
Credentials: Use per-account keychain entries #5830
SamuAlfageme commentedon Oct 24, 2017
Tested with different upgrade and multiaccount scenarios and all of them ran perfectly smooth. 🎉
Closin' here 👍 Very nice!