Skip to content
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

[BUG] PWA-AUTH unable to login with Google #2950

Closed
TelegramXPlus opened this issue May 11, 2022 · 8 comments
Closed

[BUG] PWA-AUTH unable to login with Google #2950

TelegramXPlus opened this issue May 11, 2022 · 8 comments

Comments

@TelegramXPlus
Copy link

What happened?

I was trying to create a simple login page using pwa-auth cdn. Looked at the md tutorial provided by the page (even tho it seems to be kind of old but I'm not sure, just the theme has changed). I'm working on localhost with default port of 5000 with a route called login, so I added to the allowed JS origins http://localhost:5000 and (even if not needed) https://localhost:5000. It keeps giving me Uncaught error "You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the [Migration Guide](https://developers.google.com/identity/gsi/web/guides/gis-migration) for more information."

How do we reproduce the behavior?

  1. Go to Google Developer Console and either create or select a project
  2. Set the OAuth consent screen and create a new client id by setting up your allows JS origin
  3. Create a simple web server with an HTML page that uses pwa-auth cdn
  4. Paste your client id to the googlekey attribute and try to log in

What do you expect to happen?

No response

What environment were you using?

OS: Windows 10
Browser: [brave]
Browser Version: 1.38.115 Chromium: 101.0.4951.64 (Official Build) (64-bit)

Additional context

No response

@maraah1
Copy link
Collaborator

maraah1 commented May 12, 2022

Hi thanks for submitting this inquiry. I think this would be better suited for our Discord community linked here. Our Discord community is broken down into three larger categories: getting started, building out your PWA, and packaging your PWA. There are plenty of really helpful community members and mods that will be able to help answer your questions and guide you through your PWABuiling journey :)

@maraah1 maraah1 closed this as completed May 12, 2022
@TelegramXPlus
Copy link
Author

I've already asked the question on the discord before (even tho it wasn't so detailed as described here). No replies have been given.

@bilalhaider
Copy link

@maraah1

I believe this should not be closed. I would try to summarize the situation as per my understanding.

  • the Google Signin API (gapi.auth2 client) that pwa-auth is using is deprecated
  • it is being rejected for all the new Google clients and clientIds being created now
  • this effectively renders pwa-auth unusable for such clients
  • for google client and clientids being generated till 29th July, 2022 google has provided a way to sign in using the old library by setting a special key in auth2.init options
  • by replacing the stock google-provider.js with a custom one to include this special key, I was at least able to sign in

At least inclusion of this key is required for pwa-auth to work for google for anyone who has registered their app recently.

Eventually the client library needs to be updated to GSI library. But that would need some thoughts specially because it gives no programmatic api to signin directly and instead renders its own html button.

I will try to expand this comment with links to relevant pages in google's docs

@maraah1 maraah1 reopened this May 12, 2022
@TelegramXPlus
Copy link
Author

Tho I see by looking at the examples provided by PWABuilder that they work, either I've written something wrong or I don't know. Tried with Facebook and after enabling some stuff (not listened in the tutorial) and it works.

@maraah1 maraah1 assigned maraah1 and amrutha95 and unassigned maraah1 May 13, 2022
@maraah1 maraah1 moved this to Proposed 💡 in PWABuilder May 16, 2022
@maraah1 maraah1 moved this from Proposed 💡 to Todo 📃 in PWABuilder May 16, 2022
@TelegramXPlus
Copy link
Author

Hemm. Sorry for bothering you, but I'm still waiting for some kind of response. Thanks in advance.

@amrutha95
Copy link
Contributor

Hello @TelegramXPlus ! We can get to this but since we have a lot of other priorities this sprint it may take us some time. However, if you are interested and willing to make the necessary updates and submit a PR, we would really appreciate it!

@ghost
Copy link

ghost commented Jun 15, 2022

This issue has been automatically marked as "no-recent-activity" because it requires author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost
Copy link

ghost commented Jun 22, 2022

This issue has been automatically closed because it was marked as requiring author feedback but has not had any activity for 7 days.

@ghost ghost closed this as completed Jun 22, 2022
Repository owner moved this from Todo 📃 to Done ✔️ in PWABuilder Jun 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done ✔️
Development

No branches or pull requests

5 participants