简体   繁体   English

Google不再支持ionin应用程序中来自网络视图的身份验证请求

[英]Google no longer supports authentication requests from the web view in ionin app

1) Added inappbrowser plugins 2) added googleplus plugins 3) installed ngcordova 4) install ng-cordova-oauth 1)添加了inappbrowser插件2)添加了googleplus插件3)安装了ngco​​rdova 4)安装了ng-cordova-oauth

 angular.module('starter', ['ionic','ngCordova','ngCordovaOauth']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { if(window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); } if(window.StatusBar) { StatusBar.styleDefault(); } }); }) .controller('WelcomeCtrl', function($scope, $state, UserService, $ionicLoading,$cordovaOauth) { $scope.googleSignIn = function() { console.log('In My Method'); $cordovaOauth.google("here i am using my client id", ["https://www.googleapis.com/auth/urlshortener", "https://www.googleapis.com/auth/userinfo.email"]).then(function(result) { console.log(JSON.stringify(result)); }, function(error) { console.log('In Error'); console.log(error); }); }; }) .service('UserService', function() { var setUser = function(user_data) { window.localStorage.starter_google_user = JSON.stringify(user_data); }; var getUser = function(){ return JSON.parse(window.localStorage.starter_google_user || '{}'); }; return { getUser: getUser, setUser: setUser }; }); 
 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link rel="manifest" href="manifest.json"> <!-- un-comment this code to enable service worker <script> if ('serviceWorker' in navigator) { navigator.serviceWorker.register('service-worker.js') .then(() => console.log('service worker installed')) .catch(err => console.log('Error', err)); } </script>--> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above <link href="css/ionic.app.css" rel="stylesheet"> --> <!-- ionic/angularjs js --> <script src="lib/ionic/js/ionic.bundle.js"></script> <script src="js/ng-cordova.js"></script> <script src="js/ng-cordova-oauth.min.js"></script> <!-- cordova script (this will be a 404 during development) --> <script src="cordova.js"></script> <!-- your app's js --> <script src="js/app.js"></script> </head> <body ng-app="starter" ng-controller="WelcomeCtrl"> <ion-pane> <ion-header-bar class="bar-stable"> <h1 class="title">Ionic Blank Starter</h1> </ion-header-bar> <ion-content> <a class="google-sign-in button button-block" ng-click="googleSignIn()">Sign in with Google</a> </ion-content> </ion-pane> </body> </html> 

This code is for login by google in ionic app. 此代码供Google在Ionic应用中登录。 but after this, i got a issue "Google no longer supports authentication requests from the web view. More information can be found at https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html .' 但是在此之后,我遇到了一个问题“ Google不再支持Web视图中的身份验证请求。有关更多信息, 访问https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native- apps.html 。”

Please help me to solve this issue 请帮我解决这个问题

Unfortunately, you have chosen to implement a soon-to-be-deprecated authentication mechanism for Google. 不幸的是,您选择了为Google实施即将被弃用的身份验证机制。 Apr. 2017 is what I believe is the deprecation date, after which this method will not work, and it currently does not work for newer clients. 我认为2017年4月是弃用日期,在此日期之后此方法将不起作用,并且当前不适用于新客户。

You will have to implement Google Auth login using the mechanism suggested at that website. 您将必须使用该网站建议的机制来实现Google Auth登录。 Or you can use one of the plugins available, like onymos access. 或者,您可以使用可用的插件之一,例如onymos access。

YES ,Google no longer supports authentication requests from the web view ,Google不再支持来自网络视图的身份验证请求

Just try to make use of Native Oauth Process , 只要尝试利用本机Oauth流程,

Please See the link for better understanding 请参阅链接以更好地了解

https://www.joshmorony.com/implementing-google-plus-sign-in-with-oauth-2-0-in-ionic-2/ https://www.joshmorony.com/implementing-google-plus-sign-in-with-oauth-2-0-in-ionic-2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Play音乐不再支持media_play_from_search - Google Play Music no longer supports media_play_from_search Stripe不再支持Xamarin Android中使用TLS 1.0发出的API请求? - Stripe no longer supports API requests made with TLS 1.0 in Xamarin Android? Google Analytics:Web View与App View - Google Analytics: Web View vs App View Facebook应用不再请求正确的权限 - Facebook app no longer requests the correct permissions 创建支持Flash的Android Web视图 - Create android web view which supports flash web 中的 firebase google 身份验证在 android 应用程序 webview 上不起作用 - firebase google authentication in web does not work on android app webview 从Android应用到Google Cloud Engine应用的HTTP请求身份验证 - Authentication of HTTP request from an Android App to A Google Cloud Engine App jQTouch不再支持Android? - jQTouch no longer supports Android? 在64位Android设备上从Google Play商店安装应用时,如果该应用支持,该应用是否以64位安装? - When installing an app from the Google Play store on a 64-bit Android device, does the app install as 64-bit if the app supports it? 在Android中通过Web View编辑Google文档 - Editing Google Docs from Web View in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM