Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Security
-
HD-Enabler:KeyRock
Description
Created question in FIWARE Q/A platform on 27-10-2015 at 10:10
Please, ANSWER this question AT https://stackoverflow.com/questions/33364204/fiware-keyrock-sending-ajax-requests-with-access-token
Question:
Fiware KeyRock sending Ajax requests with access token
Description:
I'm building a client for a FIWARE KeyRock GE instance in Javascript.
I have a function for querying the instance (after a successful login flow in which I received an access_token):
keyrockManager.query = function (uri, method, params, callback) {
if (params == null)
params = {};
params.access_token = keyrockManager.getAccessToken();
$.ajax(
{
url: KeyrockConfig.defaultInstanceUrl + uri,
type: method,
data: params,
dataType: "jsonp",
success: function (result, status, xhr)
,
error: function (xhr, status, error)
}
);
};
I actually thought that an open API will allow all origins but it apparently not, so I'm using jsonp because of the CORS issue.
For some reason I'm keep getting:
Uncaught SyntaxError: Unexpected token :
index.js:26 Error: jQuery1113013546996610239148_1445936551798 was not called(…)
Any idea how to solve it ?
Activity
Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
---|---|---|---|---|---|---|---|---|---|
|
8d 19h 47m | 1 | Alvaro Alonso | 31/May/17 10:52 AM | |||||
|
1s | 1 | Alvaro Alonso | 31/May/17 10:52 AM | |||||
|
1s | 1 | Alvaro Alonso | 31/May/17 10:52 AM |