Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
2.29.1
-
None
-
None
-
Unknown
-
Description
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:
Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation ; size limit: 768 table: XWIKISTRINGS column: XWS_VALUE
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.
Attachments
Issue Links
- is related to
-
XWIKI-23827 Store password properties in dedicated table
-
- Closed
-
- relates to
-
XWIKI-23816 Add checks in BaseCollection#setXXXValue to ensure the type of the field is correct
-
- Open
-