Google Oauth in Solid: Best Practices
Hi, I've got a solid start project with an actix web backend. What's the recommended approach for implementing google oauth so that I can get the google user id to the actix backend so that I can store data against it, and is there a library for this that doesn't entirely leverage solid start's server for session storage, as I'd ideally like to handle that in my actix backend? I know I can use google identity directly, and then get and send a google id token to the server, which I can then verify and use https://developers.google.com/identity/gsi/web/guides/verify-google-id-token, but it would be nice if there were an idiomatic solid way of doing the former part.
Google Developers
Overview | Authentication | Google Developers
5 Replies
I tried using Auth.js's Solid adapter https://authjs.dev/ and it worked pretty well initially. However eventually it no longer met my business requirements (I want to set the set the User's primary key instead of it being autogenned) and they rejected my PR adding that feature, so I moved to oauth4webapi.
Auth.js
Authentication for the Web.
Thanks, I'll definitely take a look at oauth4webapi, as auth.js seems to rely on solid start.
some code to get you started https://github.com/AlexErrant/Pentive/blob/main/hub/src/routes/api/auth/%5B...solidAuth%5D.ts
GitHub
Pentive/[...solidAuth].ts at main · AlexErrant/Pentive
Collaborative Spaced Repetition. Contribute to AlexErrant/Pentive development by creating an account on GitHub.
I used the github provider because google's Oauth is a huge PITA... at least initially for someone without a trademark lol
yeah, I did a spotify oauth provider from scratch a while ago and that was relatively painless
I was considering doing the same for google