Authenticating with the Edge Client
Certain actions on the Edge Client will require your users to be authenticated. We recommend authenticating your players before attempting to perform game actions using the Edge Client.
You'll need to first create a Honeycomb user before authenticating using the information below.
Authenticating with the Edge Client
Authentication using Edge Client is a 2 step process. First, send an auth request query like this:
query AuthRequestQuery($wallet: String!) {
authRequest(wallet: $wallet)
}
You will need to include the user's wallet address in the query:
{
"wallet": "pubkey" // User's wallet address in string format
}
This query will return an authRequest
string:
{
"data": {
"authRequest": "Please sign this message to authenticate to Honeycomb unified interface: 3FKg5gF2dJYbwbjQ12L3qBRErKCWPSKuLg9pKeBsJreW"
}
}
Next, you will need to get the message (in this example 3FKg5gF2dJYbwbjQ12L3qBRErKCWPSKuLg9pKeBsJreW
), signed by the user. Once the message is signed, make the second query:
query AuthRequestQuery($wallet: String!, $signature: String!) {
authConfirm(wallet: $wallet, signature: $signature) {
accessToken
user {
id
info {
pfp
name
bio
username
}
leaf_idx
proof {
leaf_index
leaf
node_index
proof
root
tree_id
}
tree_id
wallets {
shadow
wallets
}
}
}
}
Provide the user's wallet address and the signed message in the query:
{
"wallet": "pubkey", // User's wallet address in string format
"signature": "string" // Signed message
}
This query will return an accessToken
string and the user's information. The accessToken
is a JWT token that you can set as the user's header when making requests to the Edge Client.