| The accessToken and refreshToken properties of XWiki.OAuth2.TokenClass are Password properties, which are stored as short strings, limited to 768 characters by the database schema. Some providers issue longer tokens: Jira Cloud's OAuth 2.0 access tokens, for example, are JWTs over that limit. Saving such a token fails, so the authorization cannot complete. Steps to reproduce
- Configure an OAuth2 client for a provider that issues tokens longer than 768 characters (e.g. Jira Cloud)
- Authorize XWiki against that provider
Result The token document cannot be saved. With HSQLDB:
The other databases have the same limit and fail the same way. Expected The token is stored, whatever its length. The OAuth 2.0 specification does not limit the token size, so the properties should be stored as large strings and still be hidden like passwords. The values already stored should be migrated to the new property type. |