Authorize authorize = new Authorize();
List blockchains = new ArrayList();
blockchains.add(new Blockchain("ethereum", "56"));
authorize.setBlockchains(blockchains);
authorize.setAction("login");
authorize.setActionId(String.valueOf(System.currentTimeMillis()));
authorize.setProtocol("TokenPocket");
authorize.setVersion("v1.0");
authorize.setDappName("testApp");
authorize.setMemo("demo");
TPManager ins = TPManager.getInstance();
After onsuccess,How to verify the correctness of the signature on the server. For example, this is the code of metamask:
TypedData := &eip712.TypedData{
Types: eip712.Types{
"EIP712Domain": []eip712.Type{
{Name: "name", Type: "string"},
{Name: "version", Type: "string"},
{Name: "chainId", Type: "uint256"},
},
"login": []eip712.Type{
{Name: "wallet", Type: "address"},
},
},
Domain: eip712.TypedDataDomain{
Name: "login",
},
PrimaryType: "login",
Message: eip712.TypedDataMessage{
"wallet": address,
},
}
pubKey, err := beeCrypto.RecoverEIP712(common.Hex2Bytes(sign), TypedData)
This is a security issue. I hope you can let me know. thank you.