Not able to get current portal logged in user in the deployed custom WAB application

3279
1
10-08-2015 06:57 AM
BGGroup
New Contributor

I have been successful in getting the portal user in a widget developed using  WAB developer version  v1.0 . Below is code snippet to get the portal  user.

"this.portal = portalUtils.getPortal(this.appConfig.portalUrl);

var username = this.portal.user.username;"

I am able to get the the current portal username when I debug the widget. I am even able to get the portal username when I launch it through web app builder app url.

The issue is when download the code and deploy it in IIS. The application throws the error and the username is undefined . On further debugging what I could find is the application is not able get the portal username.

Any guidance  on issue would be great.

0 Kudos
1 Reply
JunshanLiu
Occasional Contributor III

When open builder, user has to sign in, so you can get user info. But if the app is deployed in other web server, user is not signed in unless a private resource is requested. So, if you want to get user info in app that deployed in other web server, you can create a widget, which has the login feature .

0 Kudos