Description
I am using rauth's OAuth2Service to handle OAuth2 authentication with Python3, and I keep getting an error about an invalid api key or secret. I have attached the code below for your reference:
I have already tried replace grant_type to code, but I receive a different error from rauth shown below:
Decoder failed to handle access_token with data as returned by provider. A different decoder may be needed. Provider returned: b\'{"reason":"Internal Error","error":"invalid_request"}
Error
{'code': 200, 'message': 'Invalid api key or secret.'}
Which App Type (OAuth / Chatbot / JWT / Webhook)?
OAuth2
I think I tried this, and I received another error. I have attached the full error below:
z = ZoomClient('****', '****', 'https://google.com')
File "/Users/***/Desktop/Zoom-Attendance/src/models.py", line 20, in __init__
self.access_token = self.get_access_token()
File "/Users/***/Desktop/Zoom-Attendance/src/models.py", line 38, in get_access_token
session = self.zoom_auth.get_auth_session(data = {'code': 'foo', 'grant_type' : 'authorization_code', 'redirect_uri' : self.REDIRECT_URL}, decoder=self.get_decoder)
File "/opt/anaconda3/lib/python3.7/site-packages/rauth/service.py", line 556, in get_auth_session
session = self.get_session(self.get_access_token(method, **kwargs))
File "/opt/anaconda3/lib/python3.7/site-packages/rauth/service.py", line 542, in get_access_token
access_token, = process_token_request(r, decoder, key)
File "/opt/anaconda3/lib/python3.7/site-packages/rauth/service.py", line 24, in process_token_request
raise KeyError(PROCESS_TOKEN_ERROR.format(key=bad_key, raw=r.content))
KeyError: 'Decoder failed to handle access_token with data as returned by provider. A different decoder may be needed. Provider returned: b\'{"reason":"Invalid authorization code foo","error":"invalid_request"}\''
The change I made was to switch grant_type to "authorization_code". I censored certain directories / client secrets using *** as they have revealing names/info.