User Login
CyberConnect uses sign in with ethereum (SIWE) login flow for users to
- send the on-chain transaction thru relay service. In this way, users would not need to pay for gas.
- It’s also used while registering signing key for storing data offchain (follow).
Login Flow
- Send
loginGetMessage
request with following fields.
Sign this message with the wallet you specified. Remember to replace \n with new lines. (unescape json) Use the following tools to sign the message with your ETH wallet.
- Use Etherscan tool
- Your familiar Ether.js, web3.js and other package
Verify the signature with gateway and save the token.
Next Step
The following mutations
require Authorization
header:
registerSigningKey
createRegisterEssenceTypedData
createCollectEssenceTypedData
createSetEssenceDataTypedData
createSubscribeTypedData
createSetSubscribeDataTypedData
relay
Use this personal access token in HTTP header Authorization
. Don’t miss the bearer
in front.
{
"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGFpbl9pZCI6MSwiZG9tYWluIjoiY3liZXJjb25uZWN0Lm1lIiwiYWRkcmVzcyI6IjB4OTI3ZjM1NTExNzcyMWUwRThBN2I1ZUEyMDAwMmI2NUI4YTU1MTg5MCIsImlzcyI6IkN5YmVyQ29ubmVjdCIsImV4cCI6MTY2NTA4NDU2MywiaWF0IjoxNjYyNDkyNTYzfQ.X3Y-gTTnsmpNRqkZ3vAAv3UOnHBb5WH5EZ2sOcJRPnw"
}