equest failed with status code 403 XSRF check failed
See original GitHub issueI have sucessfully opened a jira connection, I can read project version and now I like to add a new issue:
this.jira.issues.createIssue({
'fields': {
'project': {
'key': 'testjira'
},
'summary': 'a single ticket',
'description': 'a simple text',
'issuetype': {'id': 1}
}
})
.then((currentIssue) => {
return currentIssue;
})
.catch((err) => {
this.logError(err);
this.handleError(err);
});
This creates an error: An error occured Error: Request failed with status code 403 XSRF check failed
A google search mentions that this is a problem of the User-Agent. I have tried to change it:
this.jira = new Client({
host: host,
baseRequestConfig: {
headers: {
'Content-Type': 'application/json',
'User-Agent': 'dumy agent'
}},
authentication: {
basic: {
username: username,
password: password
}
}
});
However, this creates another error: Refused to set unsafe header “User-Agent”
Why can I read Jira, but cannot write to it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
XSRF check failed when calling Cloud APIs
Atlassian Cloud REST API are protected from Cross Site Request Forgery (XSRF/CSRF) attacks for security reasons. For this reason, requests made ...
Read more >XSRF check failed when sending POST to custom rest endpoint
Finally I solved the problem sending the request with AJAX and adding headers: { 'X-Atlassian-Token': 'nocheck' }. Hope this helps!
Read more >XSRF Check Failed on Jira Server, Error 403 - NXP Community
I am trying to call a POST (also tried a DELETE) method of a Jira Server rest api from an angular application. Unfortunately,...
Read more >Critical - Jira API call failing with 403 error · Issue #8091 - GitHub
... and RestAssured when I am trying to call same from Cypress it fails with 403 error - XSRF check failed var http...
Read more >apache 2.2 - JIRA: XSRF check failed - Server Fault
It is highly possible that your proxy blocks some of headers. Try accessing jira directly (without proxy). Also, it is possible that JIRA's ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Awesome, it works now. Thanks alot for the support 😃
@otto2me
I found a workaround to unblock you with this problem. You need to add this piece of code to your
main.js
file for run electron:I will also attach these changes specifically in your application, I hope I did not leave sensitive data there 😂
SyncTool-Small.zip
I still haven’t figured out how to make it work in the browser.
X-Atlassian-Token: nocheck
will not work because this header can only be accepted on certain endpoints,createIssue
is not included in this list.