<?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: Querying the Sense API about the current user in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/2504169#M21789</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25748"&gt;@vegard_bakke&lt;/a&gt;&amp;nbsp;, were you able to find solution around this?&lt;/P&gt;</description>
    <pubDate>Mon, 03 Feb 2025 11:58:06 GMT</pubDate>
    <dc:creator>vighnesh_gawad</dc:creator>
    <dc:date>2025-02-03T11:58:06Z</dc:date>
    <item>
      <title>Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1679173#M12381</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We are experimenting with a (Caddy) Reverse Proxy in front of Qlik Sense and other custom webservices. (Serving PDF documents, writeback capabilities to databases etc.)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Since both Qlik Sense and the custom webservice is behind the same reverse proxy, my webservice will receive the Qlik Sense session cookie.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how can I validate that the session cookie is stil valid?&lt;/P&gt;&lt;P&gt;And more importantly, can I get the username, it's roles and groups, or even saml attributes?&lt;/P&gt;&lt;P&gt;That way we could achieve some access control, based on who was logging in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone with any tips on extracting user information based on the session cookie value?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Vegard&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1679173#M12381</guid>
      <dc:creator>vegard_bakke</dc:creator>
      <dc:date>2024-11-16T03:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1681209#M12418</link>
      <description>&lt;P&gt;Since you have the session ID contained in the Session Cookie, you've got some options.&lt;/P&gt;&lt;P&gt;At the outset, the QPS API is a per virtual proxy API. This makes some sense due to the fact a given user can have a session on none, one, or many different virtual proxies. As a convention {/virtualproxy} will be used which means the prefix on the in-use virtual proxy. If it's the prefixless virtual proxy then this is not needed.&lt;/P&gt;&lt;P&gt;If you have the session cookie then you have the ID which means you can call GET /qps{/virtualproxy}/session. Example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GET /qps/session/f5a8a75d-a61e-4942-b12d-4b68d31bc26c

{
  "UserDirectory": "domain",
  "UserId": "userid",
  "Attributes": [
    {
      "UserPrincipalName": "userid@domain.com"
    }
  ],
  "SessionId": "f5a8a75d-a61e-4942-b12d-4b68d31bc26c"
}&lt;/LI-CODE&gt;&lt;P&gt;If we had session attributes, they would be displayed like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "UserDirectory": "DEMO",
  "UserId": "xyz",
  "Attributes": [
    {
      "extendedRole": "exampleRole"
    }
  ],
  "SessionId": "36ffb552-561c-484f-8ab8-a8a601f20a6b"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Now that we have the userDirectory and userId values, we can do further queries to the QRS API to get the persistent attributes which would come from a User Directory Connector:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GET /qrs/user/full?filter=(userDirectory eq 'userDirectory' and userId eq 'userId')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 09:08:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1681209#M12418</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2020-03-03T09:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1681985#M12437</link>
      <description>&lt;P&gt;Hmm.. I get empty replies when querying the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GET /qps/session/{id}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I 'm using the default virtual proxy, so that should not be the trouble.&lt;BR /&gt;What access rights does the user requesting session info need?&amp;nbsp; (Can you access any persons session, if you know the ID?)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Anyway, I'm testing with user being RootAdmin, so I din't think that is the issue, either.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;This was the session cookie for the user queried below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Session cookie.png" style="width: 491px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29612i7077C32E0F95432F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Session cookie.png" alt="Session cookie.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you spot my mistake in the curl statement below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\&amp;gt; curl --cookie cookiefile --insecure "https://qlik.company.local/qrs/user/full?filter=UserDirectory+eq+'QLIK'+and+UserId+eq+'veba'&amp;amp;xrfkey=USE0YOUR0OWN0KEY" --header "x-qlik-xrfkey: USE0YOUR0OWN0KEY" --header "User-Agent: Windows"
[
	{
	  // ...znip...
	"customProperties":[],
	"userId":"veba",
	"userDirectory":"QLIK",
	"roles":["RootAdmin"],
	"attributes":[],
	"schemaPath":"User"}
]


C:\&amp;gt; curl --cookie cookiefile --insecure "https://qlik.company.local/qps/session/f8309fb7-82f2-48f3-b8f3-a453498bf83f?xrfkey=USE0YOUR0OWN0KEY" --header "x-qlik-xrfkey: USE0YOUR0OWN0KEY" --header "User-Agent: Windows"

C:\&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user api is QRS and session api is QPS, right?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 10:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1681985#M12437</guid>
      <dc:creator>vegard_bakke</dc:creator>
      <dc:date>2020-03-05T10:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1682157#M12443</link>
      <description>&lt;P&gt;You'll want to go over 4243 using certificates:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/February2020/Subsystems/ProxyServiceAPI/Content/Sense_ProxyServiceAPI/ProxyServiceAPI-Connect-API.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/February2020/Subsystems/ProxyServiceAPI/Content/Sense_ProxyServiceAPI/ProxyServiceAPI-Connect-API.htm&lt;/A&gt;&amp;nbsp;to communicate to the QPS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:56:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1682157#M12443</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2020-03-05T15:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1682370#M12448</link>
      <description>&lt;P&gt;Is that a general advice for QPS only, or all APIs?&lt;/P&gt;&lt;P&gt;This is sidetracking: but I'm about&amp;nbsp; to integrate Qlik with an&amp;nbsp; Identity Management System, that will log on Qlik API, query registered users and delete users that no longer exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was going to advice using either NTLM or SAML to get a session cookie, and use this for the QRS API. Rather than sharing and spreading the certificates and managing this with several other systems; as well as opening extra ports in the firewall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I reconsider?&lt;BR /&gt;What are the arguments for certificate straight on the port versus going through the proxy with a session cookie?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 08:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1682370#M12448</guid>
      <dc:creator>vegard_bakke</dc:creator>
      <dc:date>2020-03-06T08:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1682449#M12449</link>
      <description>&lt;P&gt;There are always going to be trade-offs, yeah?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Going over QPS&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Pro&lt;/STRONG&gt;: Use of 443 which is already likely allowed&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Con&lt;/STRONG&gt;: You have to deal with authentication programmatically, need to maintain the session state (using the cookie) for optimal results&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Going direct using certificates&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Pro&lt;/STRONG&gt;: Certificate trust ensures relatively easy authentication, authorization comes from a header value which is easy to manipulate in virtually all languages / frameworks&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Cons&lt;/STRONG&gt;: Requires the certificate to be shared with another system, requires an additional port to be opened (potentially)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I personally find the certificate route to be easiest to implement but if an additional port is required (i.e. if the code is running on a server in a different network segment) and that is a slow-going / laborious process, I understand why someone would go with the QPS route. If you can handle the authentication programmatically, then that con for the QPS approach is not too terribly difficult. Likewise, maintaining the session state can be easy for some developers. Harder for others. The concern over the certificate is a bit odd to me. Server side automation code requires a layer of trust since it can absolutely wreck any system, any app, etc. That's a natural potential consequence to automation; doing the wrong thing automatically.&lt;/P&gt;&lt;P&gt;There isn't a one-size fits all answer here.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 12:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1682449#M12449</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2020-03-06T12:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1685457#M12502</link>
      <description>&lt;P&gt;Trade-offs are part of our trade, isn't it? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Another benefit going through the Qlik Proxy is that you can control access for that system user, as well as revoke access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for exporting client specific certificates (https://localhost/qmc/certificates), I cannot find a way to revoke the certificate once exported.&amp;nbsp; Is that correct?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I thought the sole purpose of being able to export certificates that are different from the local Qlik self-signed certificates would be that you could control each client's access.&amp;nbsp; The only &lt;A href="https://community.qlik.com/t5/Qlik-Sense-Deployment-Management/How-can-I-manage-client-certificates-used-for-Ticket-API/td-p/1109576" target="_blank" rel="noopener"&gt;other thread&lt;/A&gt; I've found is from 2016, and it is claiming that I need to recreate the QlikClient certificates (as in&amp;nbsp;&lt;A href="https://support.qlik.com/articles/000005402" target="_blank"&gt;https://support.qlik.com/articles/000005402&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know if that is still the case in 2020?&lt;/P&gt;&lt;P&gt;And do you know what the machine name is for? It's not being used to verify the sender, as far as I've tested. Is it mainly to separate the folders when exporting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Sorry, this is deviating quite a bit from the original post.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 17:18:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1685457#M12502</guid>
      <dc:creator>vegard_bakke</dc:creator>
      <dc:date>2020-03-17T17:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1685882#M12511</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;Do you know if that is still the case in 2020?&lt;/P&gt;&lt;P&gt;Yes. The generated cert comes from the same chain that the internal certificates come from. So there's a chain of trust there.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;And do you know what the machine name is for? It's not being used to verify the sender, as far as I've tested. Is it mainly to separate the folders when exporting?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Generally&lt;/EM&gt; you would just pass the client certificate. The machine name value sets the issued to value on the server certificate. Practically, this is only really helpful in scenarios where you want to migrate Qlik Sense between servers (example:&amp;nbsp;&lt;A href="https://support.qlik.com/articles/000041283" target="_blank"&gt;https://support.qlik.com/articles/000041283&lt;/A&gt;).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 20:36:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/1685882#M12511</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2020-03-18T20:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the Sense API about the current user</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/2504169#M21789</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25748"&gt;@vegard_bakke&lt;/a&gt;&amp;nbsp;, were you able to find solution around this?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 11:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Querying-the-Sense-API-about-the-current-user/m-p/2504169#M21789</guid>
      <dc:creator>vighnesh_gawad</dc:creator>
      <dc:date>2025-02-03T11:58:06Z</dc:date>
    </item>
  </channel>
</rss>

