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
- All
 - Comments
 - History
 - Activity
 - Transitions
 
2017-05-22 15:06|CREATED monitor | # answers= 0, accepted answer= False