Welcome to the Panopto Community

Get Video Title

Hello,

I am building a script to get a video ID and return its title, but I'm stuck on authentication.

I created a User-Based Server Application API client. I also created an internal Panopto user account with a password (not through SSO). When I try to get an OAuth2 token using the password grant type, I get this error: "invalid_grant" with message "Invalid username or password."

I can log into Panopto directly with this account using the same credentials, so the account and password work. But the API rejects them.

Here's what I'm sending:

POST https://clu.hosted.panopto.com/Panopto/oauth2/connect/token

Parameters:

  • grant_type: password
  • client_id: [redacted]
  • client_secret: [redacted]
  • username: [redacted]
  • password: [redacted]
  • scope: api

Is the User-Based Server Application type configured correctly to support password grant on our instance? What could cause this error if the credentials are valid?

Thank you.

Tagged:

Answers

  • Adis HrnjicaAdis Hrnjica Whiz Kid

    Hi Milad,

    Depends on your script. Does this works with Postman?

    Thanks,

    Adis

  • Hello Adis,

    I don't use Postman; instead, I use the terminal (curl), and it doesn't work.

  • Hi Milad,

    Here is my cURL that is working, and yes you would use 'User Based Server Application' client type.

    curl --location 'https://xxx.hosted.panopto.com/Panopto/oauth2/connect/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'client_id=[redacted]' \
    --data-urlencode 'client_secret=[redacted]' \
    --data-urlencode 'username=[redacted]' \
    --data-urlencode 'password=[redacted]!' \
    --data-urlencode 'scope=api'

    I hope this helps.

    Thanks,

    Adis

  • Thank you Adis,

    I created a user based server application but I get this error:
    {"error":"invalid_grant","error_description":"Invalid username or password"}

    I am sure of the username and password, and the access for the specific user account,

    Any advice is appreciate it

  • Hi Milad,

    Can you send me info about user and which api client you use in private messages.
    I can check then on your site, but I would assume you use the username wrong probably.

    Thanks,

    Adis

  • Sent you a message. Thank you Adis.

Sign In or Register to comment.