I am working with force.com REST API using PhoneGap, JQuery mobile By using REST-API tool kit if found it in Github. I am using ChildBrowser for authentication.
What i am doing is first i am logging in with ChildBrowser and getting access_token, refresh_token saving these values as cookies. If we open the next time app will use access_token until it expires. When it expires i am trying to refresh the token using
forcetk.js --> refreshAccessToekn method by setting the refresh_token which i was saved as cookie.
But it throwing an exception {error: "Invalid_grant","error_description":"expired access/refresh token"}
Please help me some one . I don't want to use child browser to login every time when open the mobile application. It should be first time only after words i am trying to refresh the token and use it.