How do I get/pass authentication for DNG using API calls?
I'm trying to access user roles and permissions on DNG. I've been able to access these websites manually, I've also passed the correct values in through Postman and got the expected results. I'm now using some older code given to me, JQuery, to download this data but I can't get the authentication to work. I keep getting 401 or 400 error codes. The codes a little scrambled right now because I keep trying new things and none of it is working. If anyone could point me in the right direction that would be great.
$.ajax({cache: false,type: "GET",url: "/jts/authenticated/identity",crossDomain: true,async: false,j_username: username,j_password: password,headers: {Accept: "application/rdf+xml","Oslc-core-version": "2.0",},$(function () {$.ajax({type: "POST",url: "/jts/authenticated/j_security_check",crossDomain: true,async: false,j_username: username,j_password: password,headers: {Accept: "application/rdf+xml","Oslc-core-version": "2.0",},$(function () {
$.ajax({type: "GET",url: baseURL + "/rm",dataType: "json",headers: {Authorization: "Basic " + btoa(username + ":" + password),"OSLC-Core-Version": "2.0",Accept: "application/xml",},error: function (msg) {console.log(msg.statusText);$("#updates").text("Error logging into RM");},}).done(function () {console.log("Logged into RM");});
Accepted answer
It can get rather complicated. I have tried to explain how it works here: https://rsjazz.wordpress.com/2021/10/15/elm-authentication/
Comments
showing 5 of 8
show 3 more comments