Hi
I am trying to develop a mobile app HTML5 + jQuery (PhoneGap) using OAuth2 Authentication.
The problem is that you can not set the header through jsonp calls, then the BasicAuthenticationFilter doesn't have opportunity to get the Authorization from the header.
http://stackoverflow.com/questions/1...p-using-jquery
Any idea how to get an access token from a mobile app?
Code:var data = { grant_type : 'password', username : $('#username').val(), password : $('#password').val(), client_id : clientId, client_secret : clientSecret, scope : 'read' }; $.ajax({ type : 'GET', url : url+'oauth/token', dataType : 'jsonp', data : data, beforeSend: function (xhr){ xhr.setRequestHeader('Authorization', make_base_auth($('#username').val(),$('#password').val())); }, success : onAuthorizeSuccess, error : onAuthorizeError });


Reply With Quote
