Please tell us how we can generate the NTLM code in ReactJS application. I tried with
username and password base64 string, but not able to succeed.
Please help, this is urgent !
Please tell us how we can generate the NTLM code in ReactJS application. I tried with
username and password base64 string, but not able to succeed.
Please help, this is urgent !
Here is the sample ReactJS code
const token = Buffer.from(${ username}:${password}
, “utf8”).toString(“base64” );
const config: AxiosRequestConfig = {
method: "get",
withCredentials: true,
url: "https://xxxxxx/odata/Processes",
headers: {
Accept: "*/*",
"Content-Type": "application/json",
"X-UIPATH-TenantName": "Default",
Authorization : "NTLM "+ token
},
};
axios(config)
.then(function (response: any) {
console.log(JSON.stringify(response.data));
})
.catch(function (error: any) {
console.log(error);
});
Read this:
https://docs.uipath.com/orchestrator/reference/authenticating#ntlm-authentication
It describes exactly what you need.
Hi @T0Bi,
The link you posted doesn’t address @AkJoshi_2 inquiry which is specifically on how to create a NTLM Token using ReactJS.
@AkJoshi_2 - I don’t use ReactJS myself - In a quick search I did see a couple people mention that they also had to set the Access-Control-Allow-Credentials
on the backend system in conjunction with the withCredentials: true
that you already have.
Other solutions I see involve implementing Identity Servers with ReactJS.
Cheers,
Tim
It does, since the answer is the same whether you’re using ReactJS or not.
Actually he wants to have the code for Axios, independent of React.
Two solutions:
Follow the link above, do everything in postman, then let postman generate your code.
Use axios-ntlm - npm
Fair enough, but the the referenced link doesn’t describe features of postman nor ReactJS / Axios as such I am pointing out it doesn’t provide anymore information than the thread this topic was split from.
I haven’t noticed before that Postman can generate client side code for a number of languages I’ll definitely be checking it out!