You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
How am I supposed to authorize an API call to create a new session with OAuth? I have gone through the steps to generate an access token, but I am always returned 401 ( "You are not authenticated. Authentication required to perform this operation." )
my call:
$.ajax ({
url: "https://myjira.com/rest/auth/1/session",
type: 'GET',
beforeSend: function(xhr) {
xhr.setRequestHeader("Authorization", "Bearer <accesstoken>");xhr.withCredentials = true;
},
success: function(response) {
alert("success");
},
error: function(error) {
alert("error");
}});
Doing this same call using basic authentication works fine, such as:
var username = $("#username").val();
var password = $("#password").val();
$.ajax ({
url: "https://myjira.com/rest/auth/1/session",
type: 'GET',
beforeSend: function(xhr) {
var base64 = btoa(username + ':' + password);
xhr.setRequestHeader("Authorization", "Basic " + base64);
xhr.withCredentials = true;
},
success: function(response) {
alert("success");
},
error: function(error) {
alert("error");
}
});
How am I supposed to authorize this call for a new session using oauth? I've spent days now searching for a working example with no luck. Thanks!
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events