Hi David, you could go down the same route that OAuth does and store a list of tokens that will grant refresh rights.
For example:
ListA: Active tokens being used
T1
T2
T3
ListB: Allow refresh token
T1
T2
T3
T4
T5
Steps
Use connects with a token (T2), he is fully authorised.
Use disconnects
T2 is removed from ListA
User reconnects with token T2
User is not authorised so check against ListB
Token T2 existing in T2
Create new token T6 and update listA and ListB
Note you will need to get the socket to request a new token using T2 as a temp token key
You will also need to expire ListA and ListB based on acceptable values
The trick here is to allow tokens to live even after the session is disconnected, but do not allow them to live forever.
Garry Taylor
Head Technical Developer
The information contained in this message is confidential and may be legally privileged. This email is for the use of the intended recipient (s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this email without the author's permission.
We have taken the precautions to minimise the risk of transmitting software viruses, but we advise you to carry out your own checks on any attachments to this message - we cannot accept any liability for any loss or damage caused by software viruses. Any opinions expressed in this message are those of the sender only and do not necessarily represent the views or opinions of Fluent Money Limited or any associated companies.
--
You received this message because you are subscribed to the Google Groups "Socket.IO" group.
To unsubscribe from this group and stop receiving emails from it, send an email to socket_io+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You could use Amazon AWS dynamoDB to store a copy of the tokens, then update the dynamoDB table to stay in sync with the tokens. However this approach involved updating the existing client facing webservice and adding the Amazon Node Module to access the table.
I am sure you are aware but you need to be very careful when using Auth tokens. I recommend using a Auth Distributed Service that handles tokens across different services. Then both the webservice and Node would use the same token based security. Lot of work but worth it in the end.