MCPcopy Create free account
hub / github.com/GearPlug/dynamics365crm-python / refresh_token

Method refresh_token

dynamics365crm/client.py:146–154  ·  view source on GitHub ↗
(self, refresh_token, redirect_uri, resource)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

parse_responseMethod · 0.95

Tested by

no test coverage detected