Other Request Example
developernaren opened this issue · 2 comments
I am creating the both and oauth2 server side. From what I understand there is an intercepter
which adds necessary headers for oauth2 request. The code is working fine when I do
OAuth.getAccessToken();
I get the access token and everything works as expected. but when I try to access resource I get error. This is the code
$http.get( SERVER_CONFIG.baseUrl + '/api/resource/' ).success(function (data) {
res(data);
})
It says CORS error, CORS header 'Access-Control-Allow-Origin' missing
. I think this not the error with the server CORS headers because when I change the grant url in the config or change the source course itself
return $http.post("" + config.baseUrl + "" + config.grantPath, data, options).then(function(response) {
OAuthToken.token = response.data;
return response;
});
to the resource url, it works fine and I get the resource, the OAuth is working an there is no CORS request error
So my question is do I need to make any changes to make the resource urls to work?
I know this is out of the scpoe of this plugin but any help is appreciated. I have spent a lot of time on this and to no avail.
it seems that the issue is with $q
when I removed that from the code the api is being hit and I am getting the request from the server. I am wondering not what was the issue with $q.
Not sure if I understand the issue. Closing for now but please reopen with sample code if needed.