0
我有一個認證檢查訪問令牌過期
"token_type":"Bearer",
"expires_in":86400,
"access_token":"XXXXXXXXX",
"refresh_token":"XXXXXXXXXXX"
我已經成功地保存了訪問令牌後,返回此一個api,刷新標記和SQLite數據庫的expires_in。我如何檢查令牌是否過期? 這裏是我迄今爲止
if(new Date().after(expiresAt)){
Toast.makeText(this, "Token expired", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(this, "You still have time", Toast.LENGTH_SHORT).show();
}
expiresAt包含expires_in值