SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Access to fetch at 'https://web.microsoftstream.com' has been blocked by CORS #2859

Closed Maksim2030 closed 4 years ago

Maksim2030 commented 6 years ago

Category

I'm trying to get content from 'https://web.microsoftstream.com/oembed' endpoint (https://docs.microsoft.com/en-us/stream/embed-video-oembed) using 'HttpClient' from "@microsoft/sp-http" on SharePoint modern page and getting an error: 'Access to fetch at 'https://web.microsoftstream.com/oembed?url=https%3A%2F%2Fweb.microsoftstream.com%2Fvideo%2Ff6df81b2-9438-4154-b32c-c023ebb2a4e3' from origin 'https://{tenant}.sharepoint.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.'

Steps to Reproduce

  1. Create basic spfx webPart with 1.4.1 version.
  2. Call "Get" request let url = 'https://web.microsoftstream.com/oembed?url=https%3A%2F%2Fweb.microsoftstream.com%2Fvideo%2Ff6df81b2-9438-4154-b32c-c023ebb2a4e3'; this.context.httpClient .get(url, HttpClient.configurations.v1) .then((response: any) =>{ // cors error })
ghost commented 5 years ago

Hi,

Are you still having issues with this? I was unable to access https://docs.microsoft.com/en-us/stream/embed-video-oembed

Have you tried using the official SharePoint stream web part instead? https://docs.microsoft.com/en-us/stream/embed-video-sharepoint @IlyeniaMaksim

msft-github-bot commented 4 years ago

This issue is being closed as part of an issue list cleanup project. Issues with no activity in the past 6 months that aren't tracked by engineering as bugs were closed as part of this inititive. If this is still an issue, please follow the steps outlined to re-open the issue.