Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alechekhova
Contributor
Contributor

View app as another user

Hello everyone!

Is it possible in Qlik Sense to load app and view it as another user

I am implementing Section Access into my apps and i want to view, how certain rules are applied to certain users

Is there any way to do it except setting the rules I want to check for myself?

 

Thanks in advance!

Alexandra

 

Labels (1)
1 Solution

Accepted Solutions
Alexis_Touet
Former Employee
Former Employee

Hi @alechekhova 

If your users are authenticated with ntlm, you can use the following script to impersonate them. 

You will need to have the QS Qlikclient certificate for the script to work, so it is best to run on a server in your environment where QS is installed.

# Generate proxy ticket 

$body = '{
  "UserDirectory": "Domain",
  "UserId": "userIDyouwanttoimpersonate"
   }'
   $hdrs = @{}
   $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
   $hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=qvservice")
   $url = "https://<QlikSenseFQDN>:4243/qps/ticket?xrfkey=iX83QmNlvu87yyAB"
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
   Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert

Once your ticket will be generated you can login as the user by pasting the ticket in your URL

https://qlikserver1.domain.local/hub?qlikticket=xxxx

Replace xxxx with your ticket.

Hope this helps.

Please don't forget to mark a correct resolution or answer to your problem or question as correct, as it will help other members to find solutions more easily 😉

View solution in original post

5 Replies
Maria_Halley
Support
Support

@alechekhova

 

Here is a video on the subject, however this is made for SaaS but most is applicable. 

 

https://community.qlik.com/t5/Knowledge/Troubleshooting-Section-Access-in-Qlik-Sense-Enterprise/ta-p...

 

 

alechekhova
Contributor
Contributor
Author

Maria, thank you very much! The video was very useful and I can implement it in my apps!

However, I would also like to know, if it possible to sort of log in as another user.

By logging in as another user I want to check, whether Section Access part of the script is written correctly and interprets user ids properly. In the past I had problems where I would print in user ids in the wrong register or lets imagine, I made a typo:) With the method shown in the video, I would be able to see the app as all the users I included in Section Access, by commenting the Section Access declaration lines. However then it would be just a field from an inline load and I might as well just type 'User1' and 'User2' as user ids. I would still be able to use the Test filter, but the Section Access won`t work, since there are no User1 and User2.

So what I`m trying to say is is there a way to see how Section Access would act after an actual log in of a certain user

Hope that makes sense:)

 

Maria_Halley
Support
Support

@alechekhova

 

I understand what you mean, but I'm sorry, I don't know. 

 

Hopefully someone else can help further here. 

abhijitnalekar
Specialist II
Specialist II

Hi @alechekhova ,

Yes, you can log in with the other user.

Either you need to open hub from a different browser or the same browser but in  incognito mode

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Alexis_Touet
Former Employee
Former Employee

Hi @alechekhova 

If your users are authenticated with ntlm, you can use the following script to impersonate them. 

You will need to have the QS Qlikclient certificate for the script to work, so it is best to run on a server in your environment where QS is installed.

# Generate proxy ticket 

$body = '{
  "UserDirectory": "Domain",
  "UserId": "userIDyouwanttoimpersonate"
   }'
   $hdrs = @{}
   $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
   $hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=qvservice")
   $url = "https://<QlikSenseFQDN>:4243/qps/ticket?xrfkey=iX83QmNlvu87yyAB"
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
   Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert

Once your ticket will be generated you can login as the user by pasting the ticket in your URL

https://qlikserver1.domain.local/hub?qlikticket=xxxx

Replace xxxx with your ticket.

Hope this helps.

Please don't forget to mark a correct resolution or answer to your problem or question as correct, as it will help other members to find solutions more easily 😉