The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

i have a CORS issue with angular 4 and electron?

keroles hakem
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 26, 2017

working on building desktop app using angular 4 and electron and try to get authentication token for jira but i am getting back  status code:  500, any help to get around this issue. i believe it is cors issue :

here is request headers:

  • :authority:somecompany.atlassian.net
  • :method:POST
  • :path:/rest/auth/1/session
  • :scheme:https
  • accept:application/json, text/plain, */*
  • accept-encoding:gzip, deflate
  • accept-language:en-US
  • content-length:51
  • content-type:application/json
  • origin:file://

return message from server: 

{"message":"Expected authority at index 7: file://","status-code":500,"stack-trace":
"java.lang.IllegalArgumentException: Expected authority at index 7: file:// ...etc
 this.http.post('https://somecompany.atlassian.net/rest/auth/1/session' , body)
.subscribe(d => {
console.log(d);
this.router.navigate(['/home']);
},
error => {
console.log('errororororororor');
console.log(error);
});

}

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Monochrome Support
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 8, 2018

You need to add headers on a proxy service using reverse proxy like nginx. I use docker to test with a reverse proxy service to add cross origin headers. Otherwise Jira doesn't allow it. At least not in Jira Cloud REST API. If you use Jira Server I believe you can whitelist apps through config/settings. The issue is actually browser side and you can use chrome plugin to disable the check but that's not advisable. 

TAGS
AUG Leaders

Atlassian Community Events