HiveAuth
Search
⌃K

Challenge request

The APP can request the PKSA to sign a challenge.
Before sending its request, the APP must create a "challenge request data" object (challenge_data) it will send to the PKSA
The structure of the challenge_data is:

challenge_data

{
key_type: string,
challenge: string
}
Properties
  • key_type: the key type required to sign the transactions. It can be one of posting|active|memo.
  • challenge: a string to be signed
The APP must then encrypt the challenge_data object using the encryption key previously shared with the PKSA (auth_key). By encrypting the sign_data object, the HAS will be unaware of what's going on between the app and the PKSA and unable to tamper with the challenge request process.
Finally, the APP sends its request to the HAS using the following message:

challenge_req

{
cmd: "challenge_req",
account: string,
token: string,
data: string
}
Properties
  • account: the Hive account name
  • token: the authentication token
  • data: the Base64 representation of an encrypted challenge_data object
The HAS will reply with a challenge_wait message:

challenge_wait

{
cmd: "challenge_wait",
uuid: string,
expire: number
}
Properties
  • uuid: a unique identifier given by the HAS to the request
  • expire: UNIX timestamp when the request will expire