Hey,
I recently noticed that my devices (mender clients) are getting another auth_set
under the auth_sets
key. (as can be seen in the picture)
Normally my logic was to accept the auth_set located at position 0 in the list.
But it seems that this do not work when there are multiple auth sets in the list.
What can cause such a behavior? I added a code to the client to reset the mender client service every 20 minutes, could it be related?
And in such cases what is the right approach - which auth set should be approved? last? first? Active?
Is there a command to delete the irrelevant auth sets?
Thanks in advance! 
Hi @Nir-Davidovitch,
New auth ids usually show up if the Mender Client creates a new key for whatever reason. So judging from your description, it sounds like something in your logic causes the client to do that.
So in a naive setup, the latest one would be the correct one, as it is the key that the Client tried to use last.
But this is definitely not a real solution, because whenever the Client repeats that, the device will go into “new request” state, the inventory and update mechanisms will stop working.
So you need to find out why it happens, client side.
Greetz,
Josef
@TheYoctoJester, Thanks for the input!
I found the cause for the auth set creation,
but this is a required procedure for the client.
So I’ll have to handle multiple auth sets situations.
Is there a command to get the most recent auth set for a device?
Extracting it using the device[“auth_sets”] creates a list of auth sets that are not always arranged by time stamp, which causes my command to not accept the most recent one.