Add public properties to google.oauth2.credentials.Credentials (#124)
diff --git a/google/oauth2/credentials.py b/google/oauth2/credentials.py
index 9727e18..077a95f 100644
--- a/google/oauth2/credentials.py
+++ b/google/oauth2/credentials.py
@@ -69,6 +69,27 @@
self._client_secret = client_secret
@property
+ def refresh_token(self):
+ """Optional[str]: The OAuth 2.0 refresh token."""
+ return self._refresh_token
+
+ @property
+ def token_uri(self):
+ """Optional[str]: The OAuth 2.0 authorization server's token endpoint
+ URI."""
+ return self._token_uri
+
+ @property
+ def client_id(self):
+ """Optional[str]: The OAuth 2.0 client ID."""
+ return self._client_id
+
+ @property
+ def client_secret(self):
+ """Optional[str]: The OAuth 2.0 client secret."""
+ return self._client_secret
+
+ @property
def requires_scopes(self):
"""False: OAuth 2.0 credentials have their scopes set when
the initial token is requested and can not be changed."""
diff --git a/tests/oauth2/test_credentials.py b/tests/oauth2/test_credentials.py
index b53b188..fa86a16 100644
--- a/tests/oauth2/test_credentials.py
+++ b/tests/oauth2/test_credentials.py
@@ -41,6 +41,11 @@
assert not self.credentials.expired
# Scopes aren't required for these credentials
assert not self.credentials.requires_scopes
+ # Test properties
+ assert self.credentials.refresh_token == self.REFRESH_TOKEN
+ assert self.credentials.token_uri == self.TOKEN_URI
+ assert self.credentials.client_id == self.CLIENT_ID
+ assert self.credentials.client_secret == self.CLIENT_SECRET
def test_create_scoped(self):
with pytest.raises(NotImplementedError):