Welcome to the Panopto Community

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.

Connecting to Panopto API using User-Based Server Application credentials

Out of all the roles listed for client/secret combination on Panopto only 1. User-Based server application (password grant) or 2. Server application (client credentials grant) suits my need as I will not have
user in the middle. I created "user-based server application" API credentials on Panopto. Then tried passing Deere user id and user password however I kept getting [{"error":"invalid_grant","error_description":"Invalid username or password"}].

Am I missing anything here?

Token_user_based_server_app.PNG
Tagged:

Answers

  • Adis HrnjicaAdis Hrnjica Whiz Kid

    Hi Gopi,

    Is this custom code or you are using some of Panopto Github samples. What are you using for scope?

    Does the call work if you use Postman?

    Can you look into sample here:
    Panopto OAuth2

    Let me know if that doesn't work and we can take a look further into your code sample.

    Thanks,

    Adis

  • Hi Adis,

    Thanks for checking out, the example you provided is for Auth code and I am trying password grant. Scope that I am using is 'api' and here is the sample code from Panopto that I am trying to use -
    panopto-api-python-examples/common/panopto_oauth2.py at master · Panopto/panopto-api-python-examples

  • Adis HrnjicaAdis Hrnjica Whiz Kid

    Hi Gopi,

    Can you use DEFAULT_SCOPE = ('openid', 'api') for scope?

    Thanks,

    Adis

  • Hi Adis,

    I tried and still same error Arguments: (400, '{"error":"invalid_grant","error_description":"Invalid username or password"}').

  • Adis HrnjicaAdis Hrnjica Whiz Kid

    Hi Gopi,

    Does this work in Postman?

    Thanks,

    Adis

  • Hi Adis, I tried and getting same error. Please find the screenshot.

    Insomnia.PNG
  • Hello Gopi,

    In Postman, instead of sending the parameters in the Body, we send it in the Auth/Authorization tab. Select the Auth type as "Oauth2.0" and in the Configure New Token section enter the following details:
    The Access token URL should be https://<your-domain>/Panopto/oauth2/connect/token

    image.png

    You will be granted a new token when you click Get New Access Token. In your python code, as the error mentions, your Grant type is invalid. In Postman, we use the Password Credentials Grant Type for a User based server application and we get the token. If the request works in postman, we can figure out if the bug is in your python code or something else entirely.

  • Hi Aishwarya,

    Thanks for your response, I have tried the same, please check if I filled in correct information. Getting error 400.

    I have fetch token option at the end which is not there in the screenshot.

    Pic.PNG
  • Adis HrnjicaAdis Hrnjica Whiz Kid

    Hi Gobi,

    Can you try to use Grant Type = Password Credentials

    I hope this helps.

    Thanks,

    Adis

  • Hi Adis, I don't have an option to choose this grant type.

Sign In or Register to comment.