-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
1. to developAccepted and waiting to be taken care ofAccepted and waiting to be taken care of29-feedbackbugfeature: authenticationfeature: owncloud migration
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Tokens from the OAuth2 app are not properly migrated when migrating from ownCloud to Nextcloud. There are two major problems:
- The schema is not adjusted properly. The
token_idcolumn is missing and thetokencolumn is superfluous (not dropped). - The existing rows in
oc_oauth2_access_tokensshould 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 to oc_authtoken and then migrate refresh tokens from oauth2_refresh_tokens to oc_oauth2_access_tokens. The key difference between both implementations is that the actual authentication tokens are saved in oc_authtoken and the refresh tokens are saved inside oc_oauth2_access_tokens (encrypted) on our end. And we don't use the table oauth2_refresh_tokens any more.
Steps to reproduce
- Use ownCloud and set up some OAuth2 clients and access tokens.
- Migrate to Nextcloud.
- Try to run repair jobs -> creates some of the new columns but errors out later:
token is not a valid attribute[OCA\OAuth2\Migration\SetTokenExpiration] - Try to authenticate from existing clients using previous access tokens -> fails
- Try to refresh existing tokens -> fails
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?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Metadata
Metadata
Assignees
Labels
1. to developAccepted and waiting to be taken care ofAccepted and waiting to be taken care of29-feedbackbugfeature: authenticationfeature: owncloud migration