I want to use "Login with Google" in my Phonegap App. I have read many articles but couldn't find out how it is done. Thanks in Advance. I tried using oAuth2 for "installed Applications" as per this URL. But then the app users have to manually copy code and paste in my app. I am using built.io Federated Login, if its relevant.
Google has dropped support for the accepted answer above! After April 20th 2017 use of the In-App browser as described by @Deep Mehta will no longer be supported. If you use the accepted answer then it is going to start failing very soon.
Here's Google's post about the change: https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
Luckily there's a new plugin that wraps up all the funcitonality that you need to do this:
https://github.com/EddyVerbruggen/cordova-plugin-googleplus and on NPM https://www.npmjs.com/package/cordova-plugin-googleplus
Here's an article on how to use it in Ionic 1 and 2 also: http://blog.ionic.io/google-oauth-changes
Again - DO NOT USE THE ACCEPTED ANSWER! It will fail after April 20 2017.