Details
-
Bug
-
Resolution: Won't Fix
-
Low
-
None
-
HCS 2.1.3
-
None
-
Severity 3 - Minor
Description
Summary
Server admins cannot update user photo as indicated in Update photo for users who are pulled from an LDAP directory.
Environment
HipChat Server 2.13 connected to an external directory (LDAP, AD, ...)
Steps to Reproduce
- Create photo.json with the following content:
{"photo" : "Result of the commad: base64 image.png or jpeg or gif"}
- Generate a V2 token with "Administer Group" scope
- Run the following command with the id of an external user:
curl -X PUT "https://<fqdn>/v2/user/<user_id>/photo?auth_token=<v2_token>" -H "Content-Type: application/json" --data @photo.json
Expected Results
Photo should update for all users if a token with the right scope is used
Actual Results
- You will get the following error:
{ "error": { "code": 403, "message": "HipChat admin cannot update an Atlassian account user's avatar.", "type": "Forbidden" } }
- The photo will not update
- Replace <user_id> with an internal user id
- The command will succeed and the photo will update
Notes
If you run:
curl -X PUT "https://<fqdn>/v2/user/<user_id>/photo?auth_token=<v2_token>" -H "Content-Type: application/json" --data '{"photo" : "$(base64 photo.png)"}'
It will fail with:
{ "error": { "code": 500, "message": "An internal error occurred. Please try again later.", "type": "Internal Server Error" } }
On the server side, this error will be logged to coral.err.log:
qBigoUBHzuwYzLtl8iu : TypeError(Error('Incorrect padding',),) 2016-12-22T10:47:49.527229+00:00 hipchat coral-2: [/user/thomas.tischner@noris.de/photo#REQOz4af0] ERROR: Sending API error: 500 - An internal error occurred. Please try again later.
Workaround
There's no workaround to update the user avatar via an API call. This is still possible manually.