How to implement oAuth authentication (like facebook)?
My code is:
function login( appID, options )
native.showWebPopup(0, 0, 300, 200,
"http://api.vkontakte.ru/oauth/authorize?client_id="..appID.."&scope="..options.."&redirect_uri=http://api.vkontakte.ru/blank.html&display=wap&response_type=token", {urlRequest = listener} )
end
function listener( event )
local url = event.url
end
This code shows popup with application permissions. When user click on "Allow permission" button, web page redirected to http://redirect_uri#access_token="access_token" page.
I need to get this access_token from redirected page to use API, but
native.showWebPopup has limitation: it can't change its URL.
So, how i can get access_token in this situation?