brisk
brisk copied to clipboard
Save two factor auth credentials
The token received from one authentication is good for some time frame defined by the response JSON. We could store this so we don't have to re-ask for a few days(?)
Here's the format of the response that includes the TTL:
{
"accessToken": "<secret>",
"dsid": 12345,
"firstName": "...",
"lastName": "...",
"nickName": "...",
"tokenExpiresAt": "2018-01-16T09:24:58+0000",
"tokenExpiresIn": "36000 Seconds",
"tokenType": "User",
"user": {
"active": true,
"appleConnectName": "...",
"company": "...",
"department": "...",
"email": "...",
"firstName": "...",
"id": 12345,
"lastName": "...",
"nickName": "...",
"phoneNumber": "...",
"type": "external"
}
}
It appears to only last 10 hours, so I don't think saving it is as useful as I hoped. We probably should anyways, we just need to know what happens when one expires so we can handle re-authing.