Authentication Methods | Android API Reference
MWSolana.initSDK
MWSolana.startLogin
MWSolana.guestLogin
MWSolana.isLoggedIn
MWSolana.loginWithEmail
MWSolana.fetchUser
MWSolana.queryUser
MWSolana.logout
MWEVM.initSDK
MWEVM.startLogin
MWEVM.guestLogin
MWEVM.isLoggedIn
MWEVM.loginWithEmail
MWEVM.fetchUser
MWEVM.queryUser
MWEVM.logout
Authentication Tips
Developer must choose which chain he wants to use
Developers must use specified classes to call APIs on specified chains.
For example, if they want to call init API on the BNB chain, they must call MWEVM.initSDK().
And this is their correspondence:
- Solana
- Ethereum
- Polygon
- BNB Chain
User login with different social accounts.
Mirror World uniquely identifies a user by their email address. Whereas you may login with different accounts, if the email address associated with that social account is different, then we shall create a new account for the users. Likewise, the wallets associated with those accounts are not the same.
Login invalidation
Authentication tokens saved locally by SDK would be out of date. So when a user opens the app, the developer should check his authentication every time. If the token is invalidated, we should guide users to login again. For example, you can follow the logic like this:
MirrorSDK.getInstance().CheckAuthenticated(new BoolListener() { @Override public void onBool(boolean boolValue) { boolean isLoggedIn = boolValue; if(isLoggedIn){ //todo: enter content directly }else { //todo: show a button leading the user to login. } }});
Edit this page on GitHub