web3?
authentication of what?
Actually, I want authentication user on backend but this authentication of frontend by web3, should we use jwt again?
What kind of authentication is it? E.g. for google, front-end gets token from google, sends token to back-end, back-end contacts google to check if token is authentic.
by metamask or wallet connect and another connectors
Are you trying to authenticate an EOA? Like that the person with some address is really the signer? In that case, you could have back-end send a random challenge msg to client, client signs msg and sends to backend, backend verifies signature.
Actually, we want mint a NFT but before mint it. first we need to authenticate the user on backend for save data on database
Ok, so you would authenticate on a per-address basis, so yes, if user changes accounts in metamask, you'd want to reauth if it's a new address that you haven't authed before for that user. So in a DB you'd want some kind of structure like {user: {authedAddresses:[0xabcd123..., 0xfedc987...]} Then if the user logs in the next day, they wont have to reauth their accounts again (assuming they're logging in to whatever service you're providing)
Обсуждают сегодня