Autenticate react moralis after firebase auth

Hello.

I have an app with the auth set via firebase (sign via metamask and firebase cloud function to log my users as explained in the tuto).

This is working fine but now i want to use the react moralis hook so i would like to authentificate it at the same time as i log my user into firebase.

I get those in the process :

const message = resultMint.data.message;
const signature = await signMessageAsync({ message });

Anyway to set the auth in react moralis with those (without prompting another signature for the user)

Thanks :slight_smile:

Any reason you want to still use Moralis server authentication while also using Firebase?

You would need to authenticate in some way - maybe you could do something like manual login as a workaround with the wallet address as username and a default password.

I have cloud functions that i need to access and have auth on firebase but I also have web3 interraction.

When i came onto the tutorial for firebase login using moralis, this seemed like the perfect solution.

The idea being to benefit from the moralis sdk and the firebase sdk with both authentified under the same user.

the problem if i call Moralis.authenticate() is that it ask for another signature when i already asked for one.

And i have the message and signature as a response so i imagine their is a way to authentificate the app with those without prompting the user again ?

I imagine a call to moralis to confirm the signature and receive the credentials or something like that ?

Iโ€™m not sure - maybe you can authenticate to your Moralis server first and then pass this session data to Firebase to do a generic โ€œauthenticateโ€ (without using Auth API or requesting another signature).

I have cloud functions that i need to access

What sort of cloud functions? Do they require a user (Moralis server) to call them?