SolvedRocket.Chat Atlassian Crowd integration doesn't work after upgrading Atllasian Crowd from 3.7.1 to 4.0.0
βοΈAccepted Answer
@karl-in-office, @flover97, @gabriellsh (@gammpamm, @fbuchmeier, @almasch)
It may happens because Crowd 4.0.0 returns Content-Type
header as application/json;charset=UTF-8
, but atlassian-crowd (aka node-atlassian-crowd) in the method ping which call the method _doRequest expects header Content-Type
only as application/json
.
So, for temporary fix this issue manually, we just have to replace the condition from
if (response.headers['content-type'] !== "application/json")
to something like
if ( !(response.headers['content-type'].includes('application/json')) )
or
if ( !(/application\/json/.test(response.headers['content-type'])) )
or as you wish.
In my case, I've just edit
/opt/Rocket.Chat/programs/server/npm/node_modules/atlassian-crowd/lib/index.js
and restart rocketchat.service
.
Other Answers:
Tonight I have spent some time on R&D and succeeded with applying the patch inside the Snap image.
Thanks @codemighty & @karl-in-office ! The patch is working good!
If other developers need to know how to apply a patch on their RocketChat Snap then they can read it on my blog:
https://www.basvanbeek.nl/linux/how-to-adjust-files-and-folders-inside-the-snap-file-system/
Description:
Our Rocket.Chat server worked correctly with Atlassian Crowd 3.7.1.
However, after upgrading Crowd from 3.7.1 to 4.0.0, Crowd integration doesn't work.
Atlassian Crowd itself works correctly with other applications (Jira, Confluence and GitLab) after upgrading to 4.0.0.
Steps to reproduce:
Expected behavior:
Crowd integration works with Atlassian Crowd 4.0.x.
Actual behavior:
Crowd integration doesn't work with Atlassian Crowd 4.0.x.
Server Setup Information:
Client Setup Information
Additional context
Relevant logs:
Rocket.Chat log:
I20200407-15:10:36.568(9) server.js:204 CROWD β error Invalid crowd connection details, check the url and application username/password and make sure this server is allowed to speak to crowd
Atlassian Crowd log:
2020-04-07 16:02:02,255 http-nio-XXXX-exec-9 INFO [plugin.rest.filter.BasicApplicationAuthenticationFilter] Invalid authentication for application with name 'APP_USERNAME'