functionrequestToken() {var issuerID ="STRING";constbaseUrl="https://sec-id-api.sandbox.securitize.io/v1/"+ issuerID +"/oauth2/authorize";var scope ="info details verification";var redirecturl ="STRING";var OAuthSecret ="STRING";// Get the CODE in the URLconstqueryString=window.location.search;consturlParams=newURLSearchParams(queryString);constcode=urlParams.get("code");var data =JSON.stringify({"code": code });var xhr =newXMLHttpRequest();xhr.withCredentials =true;xhr.addEventListener("readystatechange",function () {if (this.readyState ===4) {if (this.status ===200) {// User is logged-in and has authorized the app// Know we can get the TOKEN and start interactingvar response =JSON.parse(this.responseText);console.log("Authorized with access Token: ",response.accessToken); }console.log(this.responseText); } });xhr.open("POST", baseUrl);xhr.setRequestHeader("Content-Type","application/json");xhr.setRequestHeader("Authorization", OAuthSecret);xhr.send(data); }