Hive Authentication Services - New Session Recovery Feature

avatar
(Edited)

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 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



0
0
0.000
6 comments
avatar

Keep up the good work @arcange I really appreciate it in making hive to progress to another level it's awesome.

0
0
0.000
avatar

pixresteemer_incognito_angel_mini.png
Bang, I did it again... I just rehived your post!
Week 91 of my contest just started...you can now check the winners of the previous week!
!BEER
9

0
0
0.000