AnsweredAssumed Answered

Get current user info in Web App builder

Question asked by santi_monti on May 17, 2017
Latest reply on May 17, 2017 by rscheitlin

Hi everyone.

 

I have a web mapping application and a group map shared with some user registered, the user enters by login. What I want to accomplish is to get the information of the current user in the application, like username, group id, etc...

 

I have tried without success using the object portal and its functions like:

 

            var portal = new arcgisPortal.Portal('my url');
            var user = portal.getPortalUser();
            console.log(user);
            console.log("user id: " + user.username);

 

But I think that what I need is to access to the portal object of the application, and this code is creating a new portal instead. I have seen that using the property credential, you can access to this info as well. Any ideas?

 

Thanks in advance.

Outcomes