<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Managing cookies in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1586046#M27091</link>
    <description>&lt;P&gt;Hello Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still chasing for the information on cookies. I would appreciate any response.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 09:27:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-01-07T09:27:42Z</dc:date>
    <item>
      <title>Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1462901#M26285</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having an issue with managing cookies. I'm successfully retrieving cookies by sending the access_token as an Authorization request Headers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;/P&gt;&lt;P&gt;Cookies= Web.Contents("https://domain/api/cookie", [Headers=[Authorization= "Bearer "&amp;amp;Access_Token("password", "token", "code")[access_token], #"Content-Type"="application/json"]]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CookiesResponse = Cookies,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once the cookies are received, I'm trying to send them as an Authorization request Headers to make an API call along with the Bearer token and other parameters:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;apidata&lt;/STRONG&gt; = Web.Contents("https://domain/api/systems", [Headers =[Authorization= "Bearer "&amp;amp;Access_Token("password", "token", "code")[access_token], Cookie="CookiesResponse", #"Accept"="application/json", #"Accept-Encoding"="gzip, deflate, br"]])&lt;/P&gt;&lt;P&gt;in&lt;/P&gt;&lt;P&gt;apidata&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Access_Token is a function that gets me the access_token/Bearer.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now with this code, I'm successfully getting cookies but my API call(&lt;STRONG&gt;apidata&lt;/STRONG&gt;) is asking for credentials which shouldn't be the case. The Authorization should complete with the Headers being sent. Does anyone have an idea of why this could happen or if there is a better way to manage/send cookies with your API calls?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same thing works completely fine in Postman.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your response.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:40:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1462901#M26285</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T09:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1463030#M26286</link>
      <description>&lt;P&gt;Here is a powershell script that is working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$cloudUrl = "domain"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$requestHeaders = @{&lt;BR /&gt;Host=$cloudUrl&lt;BR /&gt;Authorization="Bearer $bearerToken"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Get the tenant cookie&lt;BR /&gt;$cookieResponse = Invoke-WebRequest -Method Get -Uri "https://$cloudUrl//api/cookie" -Headers $requestHeaders -SessionVariable cookieSession -UseBasicParsing&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$tenantCookie = $cookieSession.Cookies.GetCookies("https://$cloudUrl") | where Name -eq "CurrentAssessment"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Call API endpoint&lt;BR /&gt;$apiEndpoint = "systems"&lt;/P&gt;&lt;P&gt;#$apiEndpoint = "access"&lt;BR /&gt;$apiResponse = Invoke-WebRequest -Method Get -Uri "https://$cloudUrl/api/$apiEndpoint" -WebSession $cookieSession -Headers $requestHeaders -UseBasicParsing&lt;BR /&gt;$apiResponse.Content&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not familiar with powershell. However, since I have some experience in Java and other languages, I tried to understand what this script is doing. I feel the first&amp;nbsp;#Get the tenant cookie is working for me in my POWER QUERY but I don't understand this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SessionVariable cookieSession -UseBasicParsing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$tenantCookie = $cookieSession.Cookies.GetCookies("https://$cloudUrl") | where Name -eq "CurrentAssessment"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone could make me understand how to use these in power query, I will figure out the rest of it. Appreciate any inputs.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 10:43:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1463030#M26286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T10:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1463277#M26287</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The authorization should be specified as &lt;STRONG&gt;#"Authorization"&lt;/STRONG&gt;&amp;nbsp;.&amp;nbsp; Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Cookies= Web.Contents("https://domain/api/cookie", [Headers=[#"Authorization"= "Bearer "&amp;amp;Access_Token("password", "token", "code")[access_token], #"Content-Type"="application/json"]])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;If I answered your question please mark my post as the solution.&lt;BR /&gt;If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 11:46:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1463277#M26287</guid>
      <dc:creator>PhilipTreacy</dc:creator>
      <dc:date>2020-10-29T11:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1463530#M26289</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/264323"&gt;@PhilipTreacy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, changing it to #"Authorization" did not make any difference. I'm still receiving the same error. The error is actually from the API call to our systems:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;= Web.Contents("https://domain/api/systems", [Headers =[#"Authorization"= "Bearer "&amp;amp;Access_Token("password", "token", "code")[access_token], Cookie="CookiesResponse", #"Accept"="application/json", #"Accept-Encoding"="gzip, deflate, br"]])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Though I'm trying to send cookies here, it still asks me for sign in credentials which shouldn't be the case. I feel like the cookies are not being accepted maybe because they are not in right format or something. As a result for cookies, I get the domain as result in power query(example &lt;STRONG&gt;abc.domain.com&lt;/STRONG&gt;) and if I try opening it in any format like Json, CSV, HTML etc it has nothing.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cookies are returning results with both Authorization and #"Authorization". Don't we use #"" if there is any space in the name. Example &lt;STRONG&gt;Authorization-sample&lt;/STRONG&gt; becomes &lt;STRONG&gt;#"Authorization-sample"&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 13:38:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1463530#M26289</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T13:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1471483#M26343</link>
      <description>&lt;P&gt;Does anyone have an idea on how Power BI works with cookies. I've tried sending the CookieResponse, yet it still doesn't seem to work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 10:20:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1471483#M26343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-03T10:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1510647#M26568</link>
      <description>&lt;P&gt;@Team I've explored everything there is on the internet about cookies using power queries. There is very limited or no information. There have been a very few posts in the past about cookies asking different questions. Looks like a handful of connector might have tried using cookies so far but there is no concrete information online. Could someone from the Microsoft Team, let me know if there is a way to use cookies in Power Query.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If someone from the community has done it, I would appreciate your inputs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 10:07:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1510647#M26568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-23T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1515908#M26593</link>
      <description>&lt;P&gt;Does anyone from the community know a better way to connect with Microsoft team to get information on this topic. If anyone has any information, please do share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 10:05:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1515908#M26593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T10:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1562145#M26823</link>
      <description>&lt;P&gt;Its been quite some time and I'm still trying to get information on this. I know we would go out of vacation soon or some would already be on vacation. I would appreciate any inputs before we all head out to our vacation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wishing you all happy holidays.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 08:36:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1562145#M26823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-21T08:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Managing cookies</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1586046#M27091</link>
      <description>&lt;P&gt;Hello Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still chasing for the information on cookies. I would appreciate any response.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 09:27:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Managing-cookies/m-p/1586046#M27091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-07T09:27:42Z</dc:date>
    </item>
  </channel>
</rss>

