arcange avatar

Hive Authentication Services - New Session Recovery Feature

arcange

Published: 04 Feb 2022 › Updated: 04 Feb 2022Hive Authentication Services - New Session Recovery Feature

Hive Authentication Services - New Session Recovery Feature

alt

At any time, a connection between an application and the HAS infrastructure may be interrupted. In such a case, it is then important that the application can reconnect and know the status of a request that it sent to the HAS server it was connected to. Has the request already been processed by a PKSA or is still pending?

An existing use case

quochuy@quochuy is actually working on integrating HAS into Condenser (the hive.blog front-end) and he made his test using its iPhone running on iOS.

What he noticed is that when you switch from one application (condenser) to another (Keychain Mobile), iOS closes the WebSocket connection of the application sent in the background.

When the initial application comes back to the foreground, even if it reconnects to the HAS infrastructure, it cannot receive the result of its request because the HAS will consider the new connection as another session.

HAS now allows resuming sessions

To solve this issue, I have implemented a new feature into the HAS protocol that enables the application to resume a broken session.

To do so, it can ask the HAS to reinstate the link between its new WebSocket connection and the pending request by using the request identifier previously received. The APP sends the following message to the HAS:

attach_req
{
    cmd: "attach_req", 
    uuid: string
}

where uuid is the pending request identifier

If the request has not expired, the HAS will confirm the reconnection to the pending request with the following message:

attach_ack
{
    cmd: "attach_ack", 
    uuid: string
}

If the pending request has expired, or if the answer that it received from the PKSA has expired, the HAS server will inform the APP that it no more manage that request with the following message:

attach_nack
{
    cmd: "attach_nack", 
    uuid: string
}

If the request has meanwhile been processed by a PKSA, the HAS will have taken care to store the response waiting for a possible reconnection. Therefore, if the reconnection is successful, the HAS will immediately send the result to the application.

This is an additional feature that will for sure increase the reliability of the Hive Authentication Services.

Thanks for reading.


Support the HAS project
Vote for the proposal on PeakD
Vote for the proposal on Ecency
vote for the proposal on Hive.blog
Vote for the proposal using HiveSigner

Check out my apps and services


Vote for me as a witness alt

Leave Hive Authentication Services - New Session Recovery Feature to:

Written by

Witness - Creator of HiveBuzz, HiveSQL, HiveAuth, Engage, Hive.NET, Hive Recovery, Hive Autoclaim, Xfer

Read more #hive posts


Best Posts From arcange

We have not curated any of arcange's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From arcange