I am making a hybrid application by AngularJs/Cordova that can interact with youtube but now i have some problem with Youtube Api v3 and that is login with youtube by gmail. I have tried to redirect my application to google login page with this code:
var logged = VideosService.getGoogleLogged();
if (logged == false) {
cordova.InAppBrowser.open('https://accounts.google.com/o/oauth2/auth?client_id=' + $rootScope.googleClientId + '&redirect_uri=http%3A%2F%2Flocalhost%2Foauth2callback&scope=https://www.googleapis.com/auth/youtube&response_type=token', '_top', 'location=yes');
} else {
alert('not logged in');
}
But when i successfully logged in the api I do not know how to return to my application and save the access token to my application. Can you point me out this problem?, i have searched 3 days but no luck to me.
Thank you.