Connection to API failing (Python)
My code is:
import
requests
from
oauthlib.oauth2 import BackendApplicationClient
from
requests_oauthlib import OAuth2Session
# set your client ID and client secret
server
= "my Panopto server"
client_id
="my client_id"
client_secret
= "my client_server"
# set the token endpoint URL
token_url
= 'https://'+server+'/Panopto/oauth2/connect/token'
# create a backend application client object
client = BackendApplicationClient(client_id=client_id)
# create an OAuth2 session object
oauth = OAuth2Session(client=client)
# get the access token using the client ID and client secret
try:
token = oauth.fetch_token(token_url=token_url, client_id=client_id, client_secret=client_secret)
except Exception:
traceback.print_exc()
exit()
This fails, complaining:
oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client)
I'm at a loss. I've checked the validity of client_id and client_secret.
Any suggestions?
Answers
Hi,
To be able to properly assist you with this issue we will need you or your support contact to please open a support ticket at support.panopto.com.
Thanks,
Joe Malmsten
@Joe, that must be a joke. I opened a ticket (API related) and was directed here to ask questions and my ticket was closed!