Been following this by Amaury Martiny, really useful guide on building your very first login with metamask dapp project and getting a flavour of the wallet integration.
Only a matter of time before adding sign in with wallet becomes more mainstream.
Took a while to figure what 'nonce' meant!
In cryptography, a nonce is an arbitrary number that can be used just once in a cryptographic communication. It is often a random or pseudo-random number issued in an authentication protocol to ensure that old communications cannot be reused in replay attacks. They can also be useful as initialization vectors and in cryptographic hash functions.
The basic idea is that it’s cryptographically easy to prove the ownership of an account by signing a piece of data using a private key. If you manage to sign a precise piece of data generated by our back end, then the back end will consider you the owner of that public address. Therefore, we can build a message-signing-based authentication mechanism with a user’s public address as their identifier.
If it doesn’t seem clear, that’s all right, because we’ll explain it bit-by-bit:
Get started with the full tutorial here