Skip to main content
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Helper I
Helper I

REST API for PBIRS w/customSecuritySample - how to include cookies?

Still trying to use the REST API for the on-premise Power BI Report Server with the CustomSecuritySample. I know that I need to supply the authentication cookie that is supplied when I log into the site, but so far, I can't seem to figure out how to specify the cookies properly in the header.  I'm using the Swagger library for my REST API calls.


I've tried adding a "Cookie" entry via AddDefaultHeader - the method call doesn't generate an error, but Fidder cannot see any cookies.  Is there some other method I should be using to load the cookies with the Swagger objects?


Any suggestions?


code example:



            var server = "";
            string apiString = string.Format("https://{0}/reportsbi/api/v2.0", server);

            var clientCI = new CatalogItemsApi(apiString);
            clientCI.AddDefaultHeader("Content-Type", "application/json;charset=utf-8");
            clientCI.AddDefaultHeader("Cookie", ".ASPXAUTH=" + cookieValue + ";X-XSRF-NONCE=" + nonce + ";X-XSRF-TOKEN=" + token);

            ODataCatalogItems cItems = clientCI.GetCatalogItems();




Helper IV
Helper IV

@teros Were you able to get through the cookies process?

Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.