Authenticate using Portkey Mobile App
You can let your users authenticate with Portkey using their Portkey Mobile App by using the Portkey SDK for sign-in flow.
This is only available on iOS and Android.
Access the PortkeySDK.AuthService
The AuthService
class is the entry point for all authentication API calls. It is accessible through PortkeySDK.AuthService
.
IAuthService auth = PortkeySDK.AuthService;
Authenticate with PortkeySDK
- Log in the user directly through
AuthService
usingLoginWithPortkeyApp
.
// mySuccessCallback will be called when the user successfully authenticated with Portkey Browser Extension.
StartCoroutine(PortkeySDK.AuthService.LoginWithPortkeyApp(mySuccessCallback));
- You may choose to cancel the Portkey App Login anytime by calling
CancelLoginWithPortkeyApp
fromAuthMessage
.
// this will cancel the login flow for logging in with Portkey App when it is still authenticating the user.
PortkeySDK.AuthService.Message.CancelLoginWithPortkeyApp();
Next Steps
After the user has signed up or logged in, a DIDAccountInfo
will be returned that corresponds to the account within Portkey App used to login. DIDAccountInfo
contains signing key and account information that can be used to get a user's account balance and sign transactions.
Sign out
To sign out a user, call Logout
.
StartCoroutine(PortkeySDK.AuthService.Logout());