Hi Team,
Im facing an issue in having an access tokens.
I was able to make authorize call successfully and got the code.
With the same I’m trying to get the token, it is giving CORS error.
Im new to OKTA, any help will be very much appreciated.
Thanks in advance
My application is a single page application working in angular js.
Below is the similar code im using in my application
var data = {
grant_type: 'authorization_code',
redirect_uri : 'http://localhost:8080/mfa/callback',
code: $scope.code,
client_id :"myclientId"
}
var httpRequest;
var tokenURL = 'http://mydomain.com/oauth/token';
httpRequest = $http.post(tokenURL, $.param(data), {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'Access-Control-Allow-Origin' : '*'
}
});
var res = httpRequest.then(
function(response) {
// Handle response
});