-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(oauth2): retain support for legacy ownCloud clients #50858
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Richard Steinmetz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! I did not test the full migration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just to be sure i get it:
occ oauth2:import-legacy-oc-client CLIENT_ID CLIENT_SECRET
creates a client. We know we can do this after the Owncloud repair step has been executed because it has deleted the clients that have oc://*
as redirect uri. Right?
I guess my question is: Is it necessary to run the occ oauth2:import-legacy-oc-client
in all scenarios or only in specific ones? In which case it would be good to add details in the command description.
Only if the server has been migrated before this patch was applied or if the system config was not enabled before the migration. In those scenarios, the client was deleted from the table during the migration and has to be added manually via the new occ command. Otherwise, if the config was set and the patch was applied before the migration, the client will be retained and the command is not required to be run. Good point, I'll add this as a hint to the command's description. |
Summary
This brings back support for legacy ownCloud clients in Nextcloud. They will continue to work seamlessly even when the OAuth authentication mode (default) is used.
How to test?
oc_oauth2_access_tokens
,oc_oauth2_refresh_tokens
andoc_oauth2_clients
to a Nextcloud instance.oauth2
migrations on Nextcloud.oauth2
migrations and repair the instance:occ migrations:migrate oauth2 && occ maintenance:repair
Case 1 (best): Refresh token is retained (default)
Observe that the client will continue to work seamlessly. No prompt to login again.
Case 2 (worst): Refresh token is lost
(This case can be forced manually by removing relevant access token from the
oc_oauth2_access_tokens
table. Alternatively, you can just log out and in again in the ownCloud desktop client manually.)Observe that the the flow succeeds and the client is able to sync again.
TODO
$enableOcClientSupport
into a system/app config (currently hard-coded)Checklist