`from_user_info` currently always sets the token to None. So a credential created from a JSON is always invalid and must be refreshed. ``` >>> from google.oauth2 import credentials >>> TOKENS = 'tokens.json' # OAuth2 token storage >>> creds = credentials.Credentials.from_authorized_user_file(TOKENS) >>> creds.valid False >>> creds.expiry >>> creds.expired False ``` https://github.com/googleapis/google-auth-library-python/blob/772dac6a6512230d32cb0dfae65a1a6aa9015049/google/oauth2/credentials.py#L235-L244 If a token is available, `from_user_info` should use it. `info.get('token', None)`
from_user_infocurrently always sets the token to None. So a credential created from a JSON is always invalid and must be refreshed.google-auth-library-python/google/oauth2/credentials.py
Lines 235 to 244 in 772dac6
If a token is available,
from_user_infoshould use it.info.get('token', None)