Integrating Metamask with Firebase auth

I’ve installed the Metamask auth in a dApp that I’m building on firebase.

Now I want to “associate” every Metamask user to a Firebase Auth user.

I need that to make sure that every user can safely interact with Firestore (and set the correct firestore rules).

I guess I need to set it up using the Custom Authentication System (使用自定義身份驗證系統在 JavaScript 中使用 Firebase 進行身份驗證)

But I don’t understand how to do it. Any ideas?