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.
Panopto REST API: CORS & Auth in Brightspace Widget
in API
We are developing a custom HTML/JS widget hosted inside Brightspace (D2L). The goal of the widget is to allow students to run keyword searches across Brightspace course content, discussion tools, and News items, while also searching Panopto video transcripts within the course using the Panopto REST API endpoint:
GET /Panopto/api/v1/sessions/search?searchQuery={query}
Since this widget runs directly in the browser on the Brightspace domain, we are encountering two main technical challenges:
- CORS Error: Browser-initiated
fetchrequests from Brightspace to our Panopto site are blocked becauseAccess-Control-Allow-Origindoes not allow our Brightspace domain. - Authentication (401 Unauthorized): Because this is a client-side widget, we need a way to securely pass or obtain user context to execute searches on behalf of the logged-in student.
Questions:
- CORS: Is there a supported way (or configuration in Panopto settings) to whitelist cross-origin requests coming from our Brightspace domain for client-side calls?
- User Authentication: What is the recommended OAuth2 flow or token exchange strategy for a client-side LMS widget to authenticate against the REST API on behalf of the current user?
Any guidance or reference patterns would be greatly appreciated!
Tagged:
0
Answers
Hi Kabir,
Here are the responses to your questions, let me know if you need additional info.
CORS
https://your-institution.brightspace.com)/api/v1. That is a separate site settingAuthorization: Bearer {token}. Do not use Panopto cookies from BrightspaceAuth (401)
Recommended approach
Search
/api/v1/sessions/searchis site-wide, not course-scoped/api/v1/folders/{folderId}/sessions/searchandincludeFields=Contextfor transcript snippetsI hope this helps.
Thanks,
Adis