I borrowed the idea from the docstring of class AccessTokenCredentials.
I moved it down to get_default() and from_stream() methods.