authentication and tokenoauth

Hi all How can I validate the Google authentication in my back-end? How do I verify the token? oauth standard
kapa.ai
kapa.ai420d ago
Hey @Deleted User! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
kapa.ai
kapa.ai420d ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can check out the Google Auth example (https://refine.dev/docs/examples/auth-provider/google-auth) in the refine documentation for more information on implementing Google authentication in your refine project. ----------------------
Google Auth | refine
You can use Google Login to control access and provide identity for your app. This example will guide you through how to connect Google Login into your project using refine.
kapa.ai
kapa.ai420d ago
<@1073419683014922323> kapa.ai is still learning and improving, please let us how it did by reacting below
Omer
Omer420d ago
Hello @Deleted User , Thank you for contacting us. It seems that the question you asked is not related to Refine. You can find different solutions by conducting the necessary searches on Google.
inland-turquoise
inland-turquoise420d ago
@Omer ok is there an example or things that I need to know for client side ?
continuing-cyan
continuing-cyan420d ago
inland-turquoise
inland-turquoise419d ago
Thank you I understand that I need to change here only the ClientID in the login.tsx page and rest will handle in the backend right ? another question, is useLogout hook call: htp:/localhost:PORT/logout ? @alicanerdurmaz @Omer
continuing-cyan
continuing-cyan419d ago
useLogout calls authProvider.logout function and yes 🚀
inland-turquoise
inland-turquoise417d ago
where I should add the server url for the auth in google auth example ? @Omer @alicanerdurmaz
continuing-cyan
continuing-cyan417d ago
what do you mean by server url ? google login works with library. see: https://github.com/refinedev/refine/blob/master/examples/auth-google-login/public/index.html#L25 after you add this script, you will access google's login API by window.google
inland-turquoise
inland-turquoise417d ago
I use passport.js so I need to add in the client side the api of the login that exist in server side to move me to the google auth page we can see in the image example
No description
continuing-cyan
continuing-cyan417d ago
server and client should use same google id

on Client
1. login with google on client side, get `token`.
2. save on somewhere (in memory, localStorage, cookie)
3. add this `token` to header and send to API on every request.

on Server
1. when server get request, get token with header.
2. send this token to google server, check token is valid. (you can add other logics to improve security. compare email etc.)
3. if token is valid, send data
server and client should use same google id

on Client
1. login with google on client side, get `token`.
2. save on somewhere (in memory, localStorage, cookie)
3. add this `token` to header and send to API on every request.

on Server
1. when server get request, get token with header.
2. send this token to google server, check token is valid. (you can add other logics to improve security. compare email etc.)
3. if token is valid, send data
i'm only familiar with this workflow, and our google example shows this flow. probably you can easily implement passport.js or another auth flows but i'm not familiar
More Posts
Populate selectfield from another form's resultHey guys, been using v4 for a while now and it's great so far. I have a question in something I wantSteps to use localhost as a data provider?How to use localhost as a data provider? I have a restfull api backend running, but changing the datEdit Page fetches the Data from the REST API, but doesn't populate the form fields.Hi, I'm trying to create a Edit form for my card. I'm using `useForm` . But it isn't populating the Hi, How can I access the URL parameter?Hi, I'm trying to access the URL parameter in the 1st SS. It'll be used to fetch data. I've tried `ucookieshi all I use useTable useForm and another hooks to get the data from the backend in the backend (nodHelp with "Failed to resolve '@refinedev/inferencer/mantine"?Hi, I'm trying to adapt Refine into an existing React project (bundled by Parcel). I'm struggling towhite screen only in iPhoneHello! The problem I have is when I open my site using the ngrok url on iPhone I see a white screenCLI is not generating page?So i use the cli to create resource, yes it does create component for the resource but not page? so Swizzle of DataProviderHey Refine-Team, when I want to swizzle DataProvider, the console just displays the option to swizzlAdding routerProvider to Refine v4 errors with useLocation being used outside of a routerI am trying to upgrade my project to v4 and I've been having lots of issues. Right now trying to useAdd Refine to an existing React project?I'm wondering what the best way is to add Refine to an existing project. I tried adding the CLI, How to use Refine with JavascriptHello, What do I have to do to setup Refine to use JavaScript instead of typescript? I have checked Display success toast notificationI have created auth provider and i implemented login functionality .when I login it display toast uHow can I customize useRegister onSuccess error toast notification message?This is the refine V4 source code for useRegister hook. There is error handling, which by default thSupabase Set role upon signup or signInWithOAuthHi again everyone, How to set claim for role in Supabase when user signup with email and password orResource in useCustomMutation successNotification parameterHow do I access or pass a resource name into useCustomMutation? I use this hook to have a reorderingUse more than one Supabase Table on one PageHey lovely Refine Team, I cant find how to use Data of two Supabase Tables on one Page.how to adding custom type in option(queryOptions) select useCustom ?my use case is to overrides data from api via select options(queryOptions) but i dont know how to aTSconfig errorHey Everyone - I was wondering if anyone else was running into these errors as they were starting a I can't connect my client id as it is asking for a string instead of client_id: process.env.REACT_API can't connect my client id as it is asking for a string instead of client_id: process.env.REACT_AP