2019 Sep 16 9:05 AM
I am trying to fetch access token from HMRC Sandbox API. The below code works completely fine when I test it from my web IDE. But it doesn't work as the same in the client's system. The only difference in code is the redirect URI in the client system which is also a HTTPS link. I cannot disable web security or add CORS plugin. Is there any other way to fix this issue?
<code>var postQuery ={};
postQuery.code = that.code;
postQuery.client_id = that.getView().getModel("appView").getProperty("/clientID");
postQuery.client_secret = that.getView().getModel("appView").getProperty("/clientSecret");
postQuery.grant_type ="authorization_code";
postQuery.redirect_uri ="https://webidetesting4631275-p*******trial.dispatcher.hanatrial.ondemand.com/webapp/index.html?hc_orionpath=/DI_webide_di_workspaceletjq4u76joab5p6/Run_Reports";
$.post("https://test-api.service.hmrc.gov.uk/oauth/token", postQuery,function(data){
console.log(data);});
<code><img src="https://answers.sap.com/storage/temp/1731534-error.png"><br>
I am trying to fetch access token from HMRC Sandbox API. The below code works completely fine when I test it from my web IDE. But it doesn't work as the same in the client's system. The only difference in code is the redirect URI in the client system which is also a HTTPS link. I cannot disable web security or add CORS plugin. Is there any other way to fix this issue?
<code>var postQuery ={};
postQuery.code = that.code;
postQuery.client_id = that.getView().getModel("appView").getProperty("/clientID");
postQuery.client_secret = that.getView().getModel("appView").getProperty("/clientSecret");
postQuery.grant_type ="authorization_code";
postQuery.redirect_uri ="https://webidetesting4631275-p*******trial.dispatcher.hanatrial.ondemand.com/webapp/index.html?hc_orionpath=/DI_webide_di_workspaceletjq4u76joab5p6/Run_Reports";
$.post("https://test-api.service.hmrc.gov.uk/oauth/token", postQuery,function(data){
console.log(data);});
<code><img src="https://answers.sap.com/storage/temp/1731534-error.png"><br>
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |