How to obtain an authentication code using oAuth2
I'm trying to verify API access, but I've already run into a problem with OAuth2.
I've already created an API client as a server-side web application (Authorization Code Grant).
I thought I would get an authorization code next, but I tried accessing the following address in my browser, using the sample code in Python on GitHub(https://github.com/Panopto/upload-python-sample/blob/master/simplest/panopto_oauth2.py).
->https://XXX.ap.panopto.com/Panopto/oauth2/connect/authorize?client_id=ec3939e4-6a52-4daf-adfd-b1ee00286777&response_type=code&redirect_uri=http://localhost:9127/redirect&scope=openid api offline_access
The result was an error.
->The Client application is not known or is not authorized.
I thought that the problem was that the redirect_uri was localhost, but even if I specified the url of a temporary http server that could be accessed anonymously from the outside, it didn't change.
I think the first request from the first Client to the Panopto Oauth2 Server failed.
Could you inform me how to get an authentication code using oAuth2?
Best Answer
-
Kevin Baum Panopto Employee
Hello,
That particular error can be caused by a few different issues, including incorrect client information or an invalid redirect URL. Have you already added "http://localhost:9127/redirect" as an Allowed URL in the API Client configuration in Panopto?
If not, please log into Panopto and go to System → API Clients, find the client you are trying to use then click on its name to edit it. Once it has been edited, please add a new Allowed URL with the URL you'd like to redirect the user to after login ("http://localhost:9127/redirect"), and set the URL Type to "Redirect URL", then click on the "Add URL" button to add that as an allowed redirect URL.
I hope that this helps. Please let me know if you have any other questions, or if this does not work for you.
Thanks,
Kevin
0
Answers
Hi Kevin
The problem was solved by setting the localhost URL as the redirect URL.
Thank you for your reply.