AnsweredAssumed Answered

login/oauth2/token is not being found?

Question asked by Connor Slagowski on Sep 26, 2019
Latest reply on Mar 5, 2020 by Kristin Lundstrum

I am getting an error with my application that is confusing me. The POST call on the app to get the authorization token is not going through and the error is giving me a 404. This is the link that is on the Cancas API OAuth documentation so I'm sure it should work.


Here is the code I am using to send the Http POST request:

var get = <?php echo json_encode($_GET); ?>;
var getCode = get.getCode;
function makeCorsRequest() {
var params = "grant_type=authorization_code"+
"&code="+ getCode;

// This is a sample server that supports CORS.

var xhr = createCORSRequest('POST', url);
if (!xhr) {
alert('CORS not supported');

xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

// Response handlers.
xhr.onload = function() {
var text = xhr.responseText;
var title = getTitle(text);
alert('Response from CORS request to ' + url + ': ' + title);

xhr.onerror = function() {
alert('Woops, there was an error making the request.');



I know that the code is getting to the point that it is sending the request because I am getting the alert box that passes back the URL during the onload. It just doesn't seem to send the post to the tokens page to give me my authorization token.


Any help on this would be appreciated.