cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Moatez
Regular Visitor

Include credentials to pass cookies in request header

Hi! ,

 

I have been trying to allow crendetials in my request so i can pass my cookie with my fetch request and already configured my backend ( configured with express session ) with origin as https://app.powerbi.com which is wrong since origin is null inside a sandbox ( i tried to set origin as * include wont work that way )  , Do you guys have any idea how to do this?

 

Fetch request inside my custom visual :

 

public fetch = () => {  
     fetch(
      "http://localhost:3000/api/v1/test",
      {
        method: "GET",
        credentials: "include",   
       
      }
    )
      .then((response) => {
        return response.json();
      })
      .then((test) => console.log(test));
  };

 

Backend cors :

 

server.use(
  cors({
    origin: '*',
    credentials: true,
  }),
);

 

 

0 REPLIES 0

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors