Hello. Add parameter redirect_uri=http://tracking.wenkgps.com/post_message.html or to your own same page, that will emit GET-params via postMessage.
Then listen for postMessages and wait for successfull authorization. We, for example, have such code for authorization handling:
window.addEventListener('message', onWindowMessage);
function onWindowMessage(e) {
if (!e || !e.data || (typeof e.data !== 'string')) return;
if (!(/^loginauth:/.test(e.data))) return;
var json = e.data.slice('loginauth:'.length);
try {
json = JSON.parse(json);
} catch (e) {
Log.error('oauthPostMessage', e.data);
return;
}
oauthDone(json);
}