hey can someone help me setting up google auth with pocketbase and reactidk where to even start
hey can someone help me setting up google auth with pocketbase and react
idk where to even start
i am a beginner in general and pocketbase
27 Replies
PocketBase - Open Source backend in 1 file
Open Source backend in 1 file with realtime database, authentication, file storage and admin dashboard
yea bro i have seen but i am unable to use the oauth
the documentation only shows how to get the jwt token after the oauth
google auth is oauth
and how can i use that ?
Before starting, you'll need to create an OAuth2 app in the provider's dashboard in order to get a Client Id and Client Secret, and register a redirect URL Once you have obtained the Client Id and Client Secret, you can enable and configure the provider from your PocketBase admin settings page.
i did that .
after that i am stuck
"stuck" is surprisingly hard to help with, without a lot more information.
i mean somehow i need to access the google Oauth page which give me jwt token right . i am unable to figure out that
the consent form
some how i need to get there
but how
set that up, and from there it's the instructions in the original link. The all-in-one should do everything for you
OH thanks bro . this is what i am searching for ig . i just dint know where to find it
bro i am getting another kind of error now
you have to set that up the same in both sides of the application
(and just a friendly request, please don't call me bro)
Okay
i dont what wrong i am doing actually
these are the urls i gave
and i have a doubt should i give the react part of urls or pocketbase ones
When creating your OAuth2 app, for a callback/redirect URL you have to use the https://yourdomain.com/api/oauth2-redirect (or when testing locally - http://127.0.0.1:8090/api/oauth2-redirect ).
i did that also
not working yet
you have to change the port to the one you're actually using
which one the frontend side or the backend side ?
according to this the request goes from the backend so it has to be backend one right ?
you have two servers listening?
whichever one pocketbase is using, anyway
does it give you any errors? or the same one?
yea same
same errors
okay ig will try again .
there are two apis
pocketbase one and react one
ill get back to you
again
one min
its not working