Organize credentials (de)serialization.
Set and check token expiry.