Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
dionverbeke
Luminary Alumni
Luminary Alumni

authenticated user

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

1 Solution

Accepted Solutions
Alexander_Thor
Employee
Employee

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.

View solution in original post

3 Replies
Alexander_Thor
Employee
Employee

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.

ErikWetterberg

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

dionverbeke
Luminary Alumni
Luminary Alumni
Author

Thanks,

This confirms my findings.

Kind Regards

Dion