Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Crowd scripting synchronization

Does anyone have a solution for being able to synchronize directories in crowd prgrammatically? It can be over HTML, on the commandline in BASH, anything. We need to have a sync called immediately as part of an integrated workstream and a delay waiting for a scheduled/regular sync is not acceptable.

1 answer

0 votes
Gaurav Atlassian Team Jun 19, 2019

Hi @Richard Heasman

Right now there is no such REST API available in Crowd, but speaking technically you can do it using HTML manipulation, and hitting a certain URL.

I cannot provide you details about above both, but you can check out you Crowd's directory view, and capture the request which it makes to backend, when you hit 'Synchronize'

 

Thanks,

Gaurav Agarwal

Thanks Gaurav. I have been trying to do this for some time; each time I hit the URL I get a login error. I have set up cookies / sessions / all manner of authentication and still cannot get this authorised. Do you have any idea about authorising this call?

 

Thanks for your response

Hi @Richard Heasman

 

Can you paste the HAR files of the request that you are making, so that I can inspect and tell you what's wrong. 

curl -X GET -u "adminUsr:adminPW" --silent --output /dev/null -c - 'https://jiraURL.com/login' --insecure

Output is:

# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_domain.com FALSE /jira FALSE 0 JSESSIONID JSESSVALUE
#HttpOnly_.domain.com TRUE / FALSE 0 crowd.token_key CTOKENVALUE
domain.com FALSE /jira FALSE 0 atlassian.xsrf.token AXTOKENVALUE

 

Then using those values:


curl -X POST -H "Accept: application/json" -b 'JSESSIONID=$JSESSVALUE;crowd.token_key=$CTOKENVALUE;atlassian.xsrf.token=$AXTOKENVALUE' 'https://crowdURL.com/crowd/console/secure/directory/synchconnectorcache!execute.action?ID=6553602&atl_token=$CTOKENVALUE' --insecure

Gaurav Atlassian Team Jun 20, 2019

Hi @Richard Heasman ,

One problem, that I can spot right away is that you are logging in to Jira, but using the JSESSIONID, and AXTOKENVALUE of Jira in Crowd.

It will not work, Crowd is a separate web application, you can use the CTOKENVALUE given by Jira to login to Crowd, but you would need to get the HTML page of directory view in Crowd, and then capture the XSRF token and JSESSIONID from this page's cookies header, and then use it in the final call you are making.

 

Thanks,

Gaurav

Thanks Guarav - yes I know it points at JIRA, I found another post to indicate this was the way to go.. Ok then - following your guidance, I've tried this:

 

curl -X GET -u "adminUsr:adminPW" --silent --output /dev/null -c - 'https://CrowdURL/crowd/console/secure/directory/synchconnectorcache' --insecure

response:
# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_DOMAIN.COM FALSE /crowd FALSE 0 JSESSIONID JSESSVALUE

 

curl -X POST -H "Accept: application/json" -b 'JSESSIONID=$JSESSVALUE 'https://CrowdURL/crowd/console/secure/directory/synchconnectorcache!execute.action?ID=6553602&atl_token=$JSESSVALUE' -vvv --insecure

Still nothing.

I accept I'm a little green in the web transfer area - would you be able to give me an example?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

307 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you