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

Getting CORS error while invoking crowd REST API from my local Edited

Getting an error

Failed to load resource: the server responded with a status of 401 (Unauthorized)
localhost/:1 Access to XMLHttpRequest at 'http://192.168.50.203:8095/crowd/rest/usermanagement/1/session?validate-password=true&duration=1800' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

while invoking crowd rest api.

No issues when i run it on postman.

How can solve

please help

1 answer

0 votes


Hi Maheswari!

It looks like you're getting a CORS error, so first try going to Crowd and adding 'localhost' under Crowd admin console -> Applications -> Crowd to see if that helps.

Otherwise, there could be some missing headers in your call or an issue with proxy configuration. How is the call different coming from postman vs running it directly? For example, are you running it on the same URL (http://192.168.50.203:8095/crowd), is Crowd running on HTTPS, or do you have a proxy configured?

For example, if you're using CURL you might want to try something like this:

curl -H "Origin: http://192.168.50.203" --verbose \
http://192.168.50.203:8095/crowd/crowd/rest/usermanagement/1/session?validate-password=true&duration=1800

Otherwise, if you're using a proxy or SSL in front of Crowd you should be making the call with the right domain/scheme. If you can add the code you're using to hit the API endpoint as well as your postman call I can see what might be missing. Also, when you run postman, make sure you're running it from the same machine as your code. It could be that postman is adding some headers that are not added when you call it directly.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Jira issue check and more advanced commit verifications for Bitbucket DC

Pre-receive hooks that verify the Git commit message, the modified files, and implement similar code change controls used to be requirements of large enterprises working in regulated industries only....

0 views 0 0
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