Please note: All new registrants to the Panopto Community Forum must be approved by a forum moderator or admin. As such, if you navigate to a feature that is members-only, you may receive an error page if your registration has not yet been approved. We apologize for any inconvenience and are approving new members as quickly as possible.
Getting 400 status code on making a POST request to the OAuth2 Token URL
Diksha Gupta
Tyro
in API
I'm following this document (https://support.panopto.com/s/article/How-to-Get-OAuth2-Access-Tokens-for-Users) to get an access token for accessing the Panopto APIs. I have generated a code value via the redirect URL, but after making a POST request to the OAuth2 token URL (https://<server>/Panopto/oauth2/connect/token), I'm getting a response status code of 400.
Can someone please help with this?
Tagged:
0
Answers
Colleague of Diksha's. Adding some additional details about our OAuth construction for confirmation that we are not missing anything per the documentation listed in https://support.panopto.com/s/article/How-to-Get-OAuth2-Access-Tokens-for-Users.
The python code that we are running (resulting in a 400 status code) after getting the
code
value:The API client details
Hi Diksha and Carrie,
Thank you for the detailed information. I was able to look a little deeper at this, and noticed that we are logging an error on our side that the client secret is incorrect. Are you able to see if your response includes an "invalid_client" error?
I'd suggest trying to generate a new client secret value, and see if that helps solve the issue. You can do that by editing the API client, selecting the "Generate" button to create a new secret (and copying it somewhere else), then selecting the "Save" button to store the new client secret value. Once you've done that, please try the call again using the client ID and new client secret values, and see if that resolves the issue.
If that doesn't help solve it, or if you have any other questions, please let me know.
Thanks,
Kevin