[Bug]: The schema of oc_oauth2_access_tokens
is not adjusted properly and its data is not migrated correctly when migrating from ownCloud
#50186
Labels
1. to develop
Accepted and waiting to be taken care of
29-feedback
bug
feature: authentication
feature: owncloud migration
Bug description
Tokens from the OAuth2 app are not properly migrated when migrating from ownCloud to Nextcloud. There are two major problems:
token_id
column is missing and thetoken
column is superfluous (not dropped).oc_oauth2_access_tokens
should be migrated properly. Currently, all new columns are just added and populated with empty values, yielding broken tokens which cannot be refreshed any more.Regarding 2): If I understand the authentication logic correctly, we have to migrate tokens from
oc_oauth2_access_tokens
tooc_authtoken
and then migrate refresh tokens fromoauth2_refresh_tokens
tooc_oauth2_access_tokens
. The key difference between both implementations is that the actual authentication tokens are saved inoc_authtoken
and the refresh tokens are saved insideoc_oauth2_access_tokens
(encrypted) on our end. And we don't use the tableoauth2_refresh_tokens
any more.Steps to reproduce
token is not a valid attribute
[OCA\OAuth2\Migration\SetTokenExpiration]Expected behavior
It should migrate existing access tokens and let me create new clients and tokens.
Nextcloud Server version
29
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
The text was updated successfully, but these errors were encountered: