Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm writing an extension, but I need to get the authenticated user.
Currently
var global = qlik.getGlobal();
var vUser = '';
global.getAuthenticatedUser(function(reply){
alert('User:'+reply.qReturn);
vUser = reply.qReturn;
console.log(reply.qReturn);
});
gives me 'Personal\Me'
What is the official code in Javascript to get the authenticated user in Qlik Sense. It would be appreciated if I did not have to call the Global Qlik object.
Kind Regards,
Dion
Ye that's the way to get the authenticated user. The reason you are getting Personal\Me is because you are most likely running your code against a Sense Desktop installation which does not have any authentication/users.
Ye that's the way to get the authenticated user. The reason you are getting Personal\Me is because you are most likely running your code against a Sense Desktop installation which does not have any authentication/users.
Hi dion,
In an extension there is another possibility. You can use the initialProperties of your extension and add an expression that gives you the authenticated user, something like this:
initialProperties:{
user:{
qStringExpression: "=OSUser ()"
},
.....
Now when your paint method is called you will have the user id in layout.user.
But, of course in desktop you will get personal\me.
Hope this helps.
Erik
Thanks,
This confirms my findings.
Kind Regards
Dion