<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can't access UserName in App in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-access-username-in-app/m-p/1160061#M4065</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm developing an EB app that has a custom widget.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In the widget I am using this line to grab the current user name. The idea is to run a query based on username to limit what shows on the map widget.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getAppStore&lt;/SPAN&gt;&lt;SPAN&gt;()?.&lt;/SPAN&gt;&lt;SPAN&gt;getState&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;username&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This works like a charm in my local development environment.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;However, when I download the app and run it on my local IIS,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getAppStore&lt;/SPAN&gt;&lt;SPAN&gt;()?.&lt;/SPAN&gt;&lt;SPAN&gt;getState&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;user is always null and I couldn't get any username.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anyone know what's wrong?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 31 Mar 2022 20:29:50 GMT</pubDate>
    <dc:creator>MichaelWen_Timmons</dc:creator>
    <dc:date>2022-03-31T20:29:50Z</dc:date>
    <item>
      <title>Can't access UserName in App</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-access-username-in-app/m-p/1160061#M4065</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm developing an EB app that has a custom widget.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In the widget I am using this line to grab the current user name. The idea is to run a query based on username to limit what shows on the map widget.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getAppStore&lt;/SPAN&gt;&lt;SPAN&gt;()?.&lt;/SPAN&gt;&lt;SPAN&gt;getState&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;username&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This works like a charm in my local development environment.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;However, when I download the app and run it on my local IIS,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getAppStore&lt;/SPAN&gt;&lt;SPAN&gt;()?.&lt;/SPAN&gt;&lt;SPAN&gt;getState&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;user is always null and I couldn't get any username.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anyone know what's wrong?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 31 Mar 2022 20:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-access-username-in-app/m-p/1160061#M4065</guid>
      <dc:creator>MichaelWen_Timmons</dc:creator>
      <dc:date>2022-03-31T20:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access UserName in App</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-access-username-in-app/m-p/1160111#M4066</link>
      <description>&lt;P&gt;Is your application running anonymously? eg when you navigate to it, is the user required to login? When running in the dev environment you generally have to login. If the app is running without a user having to login, then no session would be generated. So the user will be null.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 22:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-access-username-in-app/m-p/1160111#M4066</guid>
      <dc:creator>Grant-S-Carroll</dc:creator>
      <dc:date>2022-03-31T22:24:44Z</dc:date>
    </item>
  </channel>
</rss>

