Forums

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

Basic authentication in nodejs and not understanding how to see username

yashraj basan February 3, 2020

when i requested this url - [GET] https://examplesite.atlassian/rest/api/1/session. i got this

response {
baseurl:"....",

name:"admin"
}

so, that i written code this way

const request = require("request");

var args = `Basic admin:password`;
function login() {

request.post( { url: "https://learnsite.atlassian.net/rest/auth/1/session", headers: { Authorization: args, "Content-Type": "application/json" } },

function(err, httpResponse, body) {

if (err) { return console.error("upload failed:", err); }

return console.log(JSON.stringify(httpResponse, undefined, 3)); } );

}
login();

but it is giving this error "Basic auth with password is not allowed on this instance".

i am completely confused now. please help me. thanks in advance

0 answers

Suggest an answer

Log in or Sign up to answer