biff

Wes Richardet 2025-03-24T12:30:53.571969Z

Anyone have experience swapping out auth with Firebase?

Wes Richardet 2025-03-24T12:47:36.030559Z

@foo you had mentioned earlier you were writing a blog about swapping out auth systems

Wes Richardet 2025-03-24T12:47:44.393289Z

Do you have any recommendation on this?

Wes Richardet 2025-03-24T12:47:48.862759Z

Thanks

2025-03-24T17:22:50.537329Z

Hey! If I was writing a blog post about it before, I evidently never got around to finishing it. But previous to implementing Biff's auth module I used firebase auth for my own apps and it's pretty straightforward + not too hard to just follow the Firebase docs. 1. Do the frontend integration first with https://firebase.google.com/docs/auth/web/firebaseui. If you want to do a custom UI you can switch to that after, but this way you can focus on getting authentication actually working first. I stuck with FirebaseUI for my own apps. 2. Include the firebase JWT in all your requests (e.g. using https://github.com/jacobobryant/biff/blob/1570ccc694c610422d70f4b63eeaa2ba456889ac/starter/src/com/example/ui.clj#L45) and update https://github.com/jacobobryant/biff/blob/master/starter/src/com/example/middleware.clj#L7C1-L19C63 so it decodes the JWT and merges any relevant info (mainly the user ID) into incoming requests. See https://firebase.google.com/docs/auth/admin/verify-id-tokens (you can use the java SDK)