Configure Authenticate Mode
Setup
By default, we will authenticate users which means users will need to sign on every connection. This means, that you don’t need to set any prop to automatically authenticate users.
That being said, you can explicitly control the settings using the
initialAuthenticationMode
prop and setting the value to connect-and-sign
.
initialAuthenticationMode (optional)
Usage
useAuthenticateConnectedUser
If you elect to avoid authentication initially by using connect-only
, but at
some point you want to authenticate your connected users (ie, prove ownership of
the wallet), then you can call authenticateUser
to trigger a sign request.
You can check the boolean isAuthenticating
to check on the status of a user
that is authenticating which will be either true
or false
.
Example
This video shows our demo site. Here we start with a connected user who has not yet authenticated. We call the authenticateUser method and signature request appears. Once the user signs, then Dynamic verifies the signature and returns a JWT.
Was this page helpful?