Web application with scanning qrcode

Login

For WEB application, you can scan the QR code to login via the MYKEY APP as long as you follow the SimpleWallet protocol.

WEB application should pass below JSON data to MYKEY:

// The QR code data format for login
{
    protocol string     // procotol name, wallet used to distinguish different protocols, this protocol is SimpleWallet
    version string      // Protocol version information, such as 1.0
    dappName string     // dapp name
    dappIcon string     // dapp Icon
    action string       // The assignment for login
    uuID string         // The unique id generated by dapp server for this login verification
    loginUrl string     // The url on dapp server to accept the login validation information
    expired number      // Qr code expiration time, unix timestamp
    loginMemo string    // Login note information, wallet for display, optional
    chain     string    // EOS, ETH or ANY(EOS will be used for ANY if EOS account exists)
}

MYKEY APP scan the QR code, request authentication to login, and post the signed data to the loginUrl specified by WEB application.

WEB application will receive below JSON data from MYKEY:

{
    protocol string     // protocol name,use "SimpleWallet" by default
    version string      // protocol version, e.g. "1.0"
    timestamp number    // current UNIX timestamp number
    sign string         // eos signature
    uuID string         // dapp server generated for the unique identity in this login verification
    Account string      // eos account name
    Ref string          // source, such as the wallet name mykey
}

The server side of WEB application should use the Reserved public key to verify the signature. Reserved public key could be acquired by reading MYKEY smart contract, please check DOC.

Call Contract

Sequence diagram for Web QR code scan

Please pass the data to MYKEY as follows, the data format is json:

Sign

Sequence diagram for Web QR code scan

Please pass the data to MYKEY as follows, the data format is json:

Last updated

Was this helpful?