Moralis Web3Auth for Unity WebGL

I am new to moralis and my aim is to do two things in Unity WebGL:

1. Provide social login and metamask login:
For this i tried moralis v2 sdk as well as web3auth sdk directly but they dont support unity webgl, so i followed this link as a workaround and it works by making changes in webgl index.html file Moralis HTML Web3Auth for Unity WebGl i want to know if this is the good approach or there are some other options?

2. Server side auth validation:
The above approach allows to login using social apps and metamask and also allow to get balance, my next concern is to verify this login process on my server and get balance and tokens on server rather than trusting client, how can i do that?

What type of separate server/backend are you using? If youโ€™re using Moralis servers (moralis-v1), you could send the session data to your backend and then it verifies by checking this session from your database.

yes i am using moralis-v1 and azure functions as backend.

1: How can azure function verifies the session(can you refer to any APIโ€™s for that)?
2: How can i get player balance, tokens, nfts because they are not stored in database upon
login. I think they should be fetched and synced automatically upon login, if yes then how
can i enable autosync?
3: Also how can i disable clients to modify moralis database directly?

there is a table that keeps session information for a user, you check if the session token that is received matches the session token from that tabe

you can use web3api for that

3: Also how can i disable clients to modify moralis database directly?

there are access rights like ACL/CLP, you can also write rules in code like beforeSave where you can check who can update the database

thanks for such a clear explanation, can i also use the above mentioned functionality through parse server as Moralis is removing hosting service from now on?

yes, you can do that with a self hosted parse server, a moralis server is a modified version of a parse server

1 Like