Gets Auth Token from cache (preferred) or user interaction Parameters ---------- * state: May be given, overrides (without changing) self.state * response: URI with token, can break expiration checks * check_cache: Interpreted as boolean
(self,
state=None,
response=None,
check_cache=True)
| 1093 | return token_info |
| 1094 | |
| 1095 | def get_access_token(self, |
| 1096 | state=None, |
| 1097 | response=None, |
| 1098 | check_cache=True): |
| 1099 | """ Gets Auth Token from cache (preferred) or user interaction |
| 1100 | |
| 1101 | Parameters |
| 1102 | ---------- |
| 1103 | * state: May be given, overrides (without changing) self.state |
| 1104 | * response: URI with token, can break expiration checks |
| 1105 | * check_cache: Interpreted as boolean |
| 1106 | """ |
| 1107 | if check_cache: |
| 1108 | token_info = self.validate_token(self.cache_handler.get_cached_token()) |
| 1109 | if not (token_info is None or self.is_token_expired(token_info)): |
| 1110 | return token_info["access_token"] |
| 1111 | |
| 1112 | if response: |
| 1113 | token_info = self.parse_response_token(response) |
| 1114 | else: |
| 1115 | token_info = self.get_auth_response(state) |
| 1116 | token_info = self._add_custom_values_to_token_info(token_info) |
| 1117 | self.cache_handler.save_token_to_cache(token_info) |
| 1118 | |
| 1119 | return token_info["access_token"] |
| 1120 | |
| 1121 | def get_authorize_url(self, state=None): |
| 1122 | """ Gets the URL to use to authorize this app """ |
nothing calls this directly
no test coverage detected