-
Notifications
You must be signed in to change notification settings - Fork 161
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
Discontinuing authorization support for the Google Sign-In JavaScript Platform Library #202
Comments
This is now a blocker for new applications. The component throws an error if you attempt to initialize it for a new application as of 5/27/22 |
i got this message: |
Same error as everyone else. I have an older Angular app that also used the deprecating Google API. I'll see if I can get that working so you can maybe use it as an example for how to migrate. |
In the meanwhile, if you have a new client id and want to make it work - adding a CapacitorGoogleAuth/src/web.ts Lines 71 to 73 in 4d05537
Example:
I've tested it and it works for me, although obviously you'd need to fork the plugin as it has to be added to options in the plugin web source code. Source: https://developers.google.com/identity/sign-in/web/reference#gapiauth2clientconfig Additional info: abacritt/angularx-social-login#489 (comment) EDIT: For anyone forking this plugin to make the change, |
hi @anthonnyc2 @craigdrabiktxmq @onyet @americoperez49 @mrakowski0 |
I'll take a look over the weekend but my fork works fine so should this 👍 thanks |
I'v tested, 3.1.4 worked. No need custom build anymore. Thanks @reslear. |
Just curious, although we can now surpass the error and use the deprecated service. But when google stop support it. Is mobile apps still work. Although there is SDK on Android and iOS but Ionic App is just a web that wrapped by native App. How do you think about this? 🤔 @reslear , @mrakowski0 |
@kyoz this only for WEB PWA, later need migrate to Google Identity Services, iOS and Android remain the same. |
Ok, thanks you very much for the information @reslear 😸 |
Hi @Epameinondas-Theodoropoulos , just follow exactly this tutorial and it'll work, just remind that if you want to login on Android, you have to use web token, just as he said on the video. One more plus that if you just created your token, you have to wait for a few minutes (or even hours). Just it doesn't work right away. |
Hello @kyoz . I have seen this video and it worked with the previous version . The video is also old. It use a configuration that someone does not need with Capacitor 3. So in the end Is the same structure as the video mentioned only that i upgrade to 3.4.1 for this library to solve the problem with google. If someone has a solution please help. I did this and have the above errors. |
What are your main platform, mobile or web app. If it's a web app, you should call |
Mobile. But I use the I also have added the google-services.json in the android folder |
As far as I know, on mobile device,
|
Yes but this is not the issue here. The issue is that the login do not work anymore with the android or ios :) |
That's odd, i'v tested on all most all android and iOS version and it's all work. Your issue is definitely due to missing st in configurations.
|
I have done this too. It is weird that it works for the web and not for the android and ios. Can we understand something from the console.log errors ? Because I am trying to find something in the web with the errors and I cannot find anything |
What is your scopes, have you place this in your
|
Yes I have. I also used the realease.keystore that i generated from android studio ( not the default debug.keystore) |
Apaparently there is an error between the debug.keytore and the release.keystore. When I add the debug.keystore in the google console (OAuth 2.0 Client IDs - Android Client) and I build the grandle with this in android studio, everything works. But when I add the release.keystore in the google console , it only works for the web and not for android or ios. What is going on? This is very weird. |
For the web version, are you planning to migrate to google identity before the deprecation date? |
PR welcome |
Looks like someone could use that documentation |
Looks like this was closed with only a workaround and hasn't actually switched away from the old library and updated the implementation to use the new GIS client. This is also tracked in the newly opened issue #231 Is this going to be addressed in the next few weeks? If not, I need to start looking for alternative libraries or introduce a hard split for iOS vs web builds of my app and add my own GIS client. |
@gamezfreak PR welcome :) |
For anyone having this error on the console |
I found very good solutions in libraries for frameworks:
should we abandon web implementation altogether and make adapters? |
Yeah. Web implentation can be done with other libraries. It's just an extra feature in this plugin. |
Yes , separating the web implementation would be much better, native and web will be handled differently . And yeah react: https://github.com/MomenSherif/react-oauth is really good library with google recent identity one tap login. So extending current with above libraries will be much better 👍👍 |
I have a plan to do a complete removal of the web version using the https://capacitorjs.com/docs/plugins/web#unimplemented supporting only native platforms at the moment. and to support the web version write use cases with ready libraries for frameworks or js . Vue3 example: <script setup>
// TODO: await import()
import { googleAuthCodeLogin } from "vue3-google-login"
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth'
import { Capacitor } from '@capacitor/core'
const code = ref('')
onMounted(() => {
if (Capacitor.isNativePlatform()) {
GoogleAuth.initialize({
clientId: ''
})
}
})
async function login() {
// iOS, android
if (Capacitor.isNativePlatform()) {
const response = await GoogleAuth.signIn()
code.value = response.serverAuthCode
return
}
// web
const response = await googleAuthCodeLogin({
clientId: ''
})
code.value = response.code
}
</script>
<template>
<button @click="login">Login Using Google</button>
</template>
Please respond emoji. |
The unimplemented approach fixes the main issue, but it doesn't necessarily makes it easier to seamlessly test and debug auth (which often happens in browser). It'd be nice to be able to configure the web version using an option param. I feel the latest GSI lib is pretty good on its own, but we could even toggle between different implementations for web. ex:
|
I got this message on the JS console.
According to https://developers.googleblog.com/2022/03/gis-jsweb-authz-migration.html are you planning to do this migration in the near future?
The text was updated successfully, but these errors were encountered: