(self, refresh_token, redirect_uri, resource)
| 144 | raise Exception("The attributes necessary to exchange the code were not obtained.") |
| 145 | |
| 146 | def refresh_token(self, refresh_token, redirect_uri, resource): |
| 147 | if self.client_id is not None and self.client_secret is not None and refresh_token is not None and redirect_uri is not None and resource is not None: |
| 148 | url = "https://login.microsoftonline.com/common/oauth2/token" |
| 149 | args = {"client_id": self.client_id, "grant_type": "refresh_token", "refresh_token": refresh_token, |
| 150 | "redirect_uri": redirect_uri, "client_secret": self.client_secret, "resource": resource} |
| 151 | response = requests.post(url, data=args) |
| 152 | return self.parse_response(response) |
| 153 | else: |
| 154 | raise Exception("The attributes necessary to refresh the token were not obtained.") |
| 155 | |
| 156 | def set_token(self, token): |
| 157 | """ |
nothing calls this directly
no test coverage detected