New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google OAuth no longer works due to restrictions #48
Comments
I guess it is not possible to use it with Google like described in the README of https://github.com/nraboy/ng-cordova-oauth. Then I would suggest to remove the option completely. |
@nraboy @mircowidmer it's possible to implement support for Google. Obviously it requires more infrastructure setup. By the way, there is also OauthBrowser adapter in this lib which currently supports Google ;) Cordova adapter doesn't support. In my application I use https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller . I implemented OauthSafariController which does the same but opens urls in SafariController/Chrome tabs. Then you need to configure Applinks/Universal links for your application (or at least custom app scheme) and put URL to your website in Google in allowed redirect urls. So, when user authenticate via Google oauth, Google server will redirect user to your site. In case of configured Applinks/Universal links Safari VC will open your application and you can route this to whatever you want (I personally just emitting even in App bus). OauthSafariController listens for this event and closes Safari. <head>
<script type="text/javascript">
if (location.pathname.indexOf('/login') === 0 && location.search.indexOf('?mobile=1') === 0) {
window.location = 'myappscheme://' + location.pathname + location.search
}
</script>
</head> Afterwards user is successfully logged in. Maybe a bit later I will do PR but this will add 2 additional dependencies Ionic Deeplinks and Cordova Safari View Controller |
Also there is #60 which is sitting there to partially fix issue with google (actually allows to put custom query params in redirect uri). I tested this approach on facebook provider and it works great :) |
Please check #61 which implements support for Safari View Controller and Google oauth. |
Merged into the development branch. Can I get some people to test the development branch? After I will merge it to a release build. |
You'll need to clone the project on GitHub, build it with the TypeScript compiler, then add it to your Cordova project from your local machine. The compiled files don't reside on GitHub, and the development branches are not checked into NPM. Best, |
Hi. I get many errors trying to compile:
src/platform/safari.ts(32,26): error TS1180: Property destructuring pattern expected. Previously I've had to add this line on tsconfig.json
regards |
I tried using Google OAuth similar to this description: https://www.thepolyglotdeveloper.com/2016/01/use-ng2-cordova-oauth-for-all-your-ionic-2-oauth-needs
Instead of using Facebook, I tried Google and registered my app in the developer console. But it seems that it is not possible anymore to use Google OAuth embedded in a web view (https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html)
Is this a known issue and is there an other way to use Google as an identity provider?
The text was updated successfully, but these errors were encountered: