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 SimpleWalletversion string // Protocol version information, such as 1.0dappName string // dapp namedappIcon string // dapp Iconaction string // The assignment for loginuuID string // The unique id generated by dapp server for this login verificationloginUrl string // The url on dapp server to accept the login validation informationexpired number // Qr code expiration time, unix timestamploginMemo string // Login note information, wallet for display, optionalchain 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 defaultversion string // protocol version, e.g. "1.0"timestamp number // current UNIX timestamp numbersign string // eos signatureuuID string // dapp server generated for the unique identity in this login verificationAccount string // eos account nameRef 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.
Please pass the data to MYKEY as follows, the data format is json:
// Contract call data format{protocol string // protocol name,use "SimpleWallet" by defaultversion string // protocol version, e.g. "1.0"action string // action type, use "transaction"dappName string // DApp namedappIcon string // DApp icon urldesc string // Semantic description of MYKEY display to the user contract callcallback string // Deeplink MYKEY callback to DApp, e.g. custom://custom.com/contractnotifyUrl string // The callback URL endpoint of DAppServer for receive success notification from MYKEYContractRequest [ // Arrary of contact actions, include transfer and non-transfer actions{ // non-transferaccount string // contract code namename string // contract action nameinfo string // Semantic description of MYKEY display to the user about this actiondata object // The parameter object passed according to the contract abi definition e.g. {key1: value1, key2: value2 }},{ // transferaccount string // contract code namename string // contract action nameinfo string // Semantic description of MYKEY display to the user about this actionTransferDataRequest {from string // Fromto string // Toquantity string // Amount and Symbol,e.g. "1.0000 EOS"memo string // Memo}}]expired number // Only in web QR code mode, expire date,unix timestamp}
Please pass the data to MYKEY as follows, the data format is json:
// Sign call data format{protocol string // protocol name,use "SimpleWallet" by defaultversion string // protocol version, e.g. "1.0"action string // action type, use "sign"dappName string // DApp namedappIcon string // DApp icon urldesc string // Semantic description of MYKEY display to the user contract callmessage string // Unsigned messagescallback string // Deeplink MYKEY callback to DApp, e.g. custom://custom.com/contractnotifyUrl string // The callback URL endpoint of DAppServer for receive success notification from MYKEYexpired number // Only in web QR code mode, expire date,unix timestamp}