IHTSDO / component-identifier-service-legacy

A REST Server for managing the generation and assignment of Terminology Component Identifiers.
Other
1 stars 4 forks source link

Crowd questions #27

Closed Myu-Unix closed 4 years ago

Myu-Unix commented 4 years ago

Hello dears,

I've setup Atlassian Crowd 4.1.1 in order to be able to log into the admin UI of my locally deployed CIS but I keep getting 401 from the /login endpoint

Invalid Response from Atlassian Crowd","statusCode":401}

Debugging, I have found that the error is raised by node_modules/atlassian-crowd/lib/index.js at this line :

if (response.headers['content-type'] !== "application/json") {
  error = new Error("Invalid Response from Atlassian Crowd");

Which leads me to believe that the underlying npm lib (atlassian-crowd:0.4.4) is not compatible anymore with Crowd 4.1.1 (?)

Could you tell me which version of Crowd do you use on your end so I can align ? :)

I can access Crowd with the App credentials I've defined on it with curl and HTTP basic auth so my "Crowd app" seems to be working as intended

curl http://app_name:app_pwd@myserver.mydomain:8095/crowd/rest/usermanagement/latest/user?username=myuser

Also I am still unsure of the format expected for the 3 variables to set, right now I have this :

export CROWD_URL=http://myserver.mydomain:8095/crowd/
export CROWD_APP_NAME=cis_test01
export CROWD_APP_PASSWORD=cis_test01
node app.js

Could you perhaps provide a obfuscated example of a working CROWD_URL variable ?

Cheers and thanks a lot for your time !

kaicode commented 4 years ago

Hi @Myu-Unix,

We are using Atlassian Crowd 3.3.6. I'm sorry, I'm not sure if the npm library is compatible with Crowd 4.x.

We are using Supervisor to start CIS. The Supervisor script contains the environment variables. Here is an obfuscated version:

[program:cis]
user = root
directory = /opt/cis
command = /usr/bin/node /opt/cis/app.js host=some-cloud-mysql dbName=some_idservice dbuser=some-user dbpass=somepassword
environment=NODE_TLS_REJECT_UNAUTHORIZED=0,CROWD_URL=https://dev-crowd.ihtsdotools.org/crowd/,CROWD_APP_NAME=component-id-service,CROWD_APP_PASSWORD=somepassword
autostart = true
autorestart = true
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_logfile_maxbytes=10485760
stderr_logfile_maxbytes=10485760

We have crowd deployed on the root context but everything seems to live under /crowd anyway. What you have looks good to me. Our NODE_TLS_REJECT_UNAUTHORIZED flag doesn't look good to me, this was probably a workaround for an expired certificate in dev. I doubt we are using that in production.