You need both. Admin SDK is for the server only. The client sdk is still needed from the client. You must get a token directly from Firebase Auth and then send it to the server for creating the session cookie. See 9:22
Not sure why they had to put the 2-week cookie expiry limitation. The client SDK doesn't log you out after 2 weeks. Now, we need to redirect the user to the login page on the server, then wait for authStateChange on the client, then renew the cookie so that we can redirect the user back to the original URL on the client side. All this while the user is seeing some pages come and go.
Watch all the Firebase Summit sessions → goo.gle/firebasesummit2022-all
Hey @Firebase, can you please share the source code for server rendered website authentication for NextJS?
I love Firebase so much! It made it a lot easier to build a system to track our music video production
Hi, what about the dynamic framework support? I am building server api and would like to test using swagger but I need ID token
But how do i log out a user?
If I use admin sdk , do I need client sdk ?
You need both. Admin SDK is for the server only.
The client sdk is still needed from the client. You must get a token directly from Firebase Auth and then send it to the server for creating the session cookie.
See 9:22
How do I sign in the user?
Not sure why they had to put the 2-week cookie expiry limitation. The client SDK doesn't log you out after 2 weeks. Now, we need to redirect the user to the login page on the server, then wait for authStateChange on the client, then renew the cookie so that we can redirect the user back to the original URL on the client side. All this while the user is seeing some pages come and go.
The repo, please.
What about CSRF then? Are we supposed to handle it ourselves...
is your - custom - backend... so YES
Yes, you need to handle it yourself 😌
@@maskman4821 Kinda sucks then... since other solutions handle this for you.
Source code could be useful.
How to do server-side sign-in from the client. THAT AIN’T SERVER SIDE BUDDY.
piwo pije