Lines Matching +full:x +full:- +full:access +full:- +full:token
7 # http://www.apache.org/licenses/LICENSE-2.0
29 All credentials have a :attr:`token` that is used for authentication and
30 may also optionally set an :attr:`expiry` to indicate when the token will
37 Although the token and expiration will change as the credentials are
46 self.token = None
47 """str: The bearer token that can be used in HTTP headers to make
50 """Optional[datetime]: When the token expires and is no longer valid.
51 If this is None, the token is assumed to never expire."""
67 # expiration early so that we avoid the 401-refresh-retry loop.
68 skewed_expiry = self.expiry - _helpers.REFRESH_THRESHOLD
75 This is True if the credentials have a :attr:`token` and the token
78 return self.token is not None and not self.expired
87 """Refreshes the access token.
97 # pylint: disable=missing-raises-doc
101 def apply(self, headers, token=None): argument
102 """Apply the token to the authentication header.
106 token (Optional[str]): If specified, overrides the current access
107 token.
110 _helpers.from_bytes(token or self.token)
113 headers["x-goog-user-project"] = self.quota_project_id
116 """Performs credential-specific before request logic.
119 apply the token to the authentication header.
129 # pylint: disable=unused-argument
156 These are useful in the case of services that support anonymous access or
175 def apply(self, headers, token=None): argument
178 The optional ``token`` argument is not supported.
181 ValueError: If a token was specified.
183 if token is not None:
194 OAuth 2.0-based credentials allow limiting access using scopes as described
199 Some credentials require scopes in order to obtain a token. You can check
215 these credentials can be used as-is.
217 .. _RFC6749 Section 3.3: https://tools.ietf.org/html/rfc6749#section-3.3
237 """True if these credentials require scopes to obtain an access token.
262 OAuth 2.0-based credentials allow limiting access using scopes as described
267 Some credentials require scopes in order to obtain a token. You can check
283 these credentials can be used as-is.
285 .. _RFC6749 Section 3.3: https://tools.ietf.org/html/rfc6749#section-3.3
312 as-is.
319 Google client library. Use 'scopes' for user-defined scopes.
346 # pylint: disable=missing-raises-doc,redundant-returns-doc
353 # pylint: disable=missing-raises-doc
360 # pylint: disable=missing-raises-doc