sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

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

Open Maksim2030 opened this issue 8 years ago • 2 comments

Category

  • [ X] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

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 })

Maksim2030 avatar Oct 31 '18 15:10 Maksim2030

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

ghost avatar May 02 '19 20:05 ghost

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.

msft-github-bot avatar Jan 22 '20 21:01 msft-github-bot