<?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 Logged in via OAuth, but cannot access portal properties in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/logged-in-via-oauth-but-cannot-access-portal/m-p/1201965#M11256</link>
    <description>&lt;P&gt;After a bit of deliberation I was finally able to get the OAuth credential generation working in a net6 wpf application.&amp;nbsp; See&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-net-questions/challenge-handler-not-called-in-wpf/m-p/1199604#M11212" target="_self"&gt;&amp;nbsp;Challenge Handler not called in WPF&lt;/A&gt;&amp;nbsp;I took a bit of a different approach than discussed there, shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; // Calls await ArcGISPortal.CreateAsync(new Uri(ServerUrl));
_portal = await _authenticationHelper.OpenPortalAsync();

//Done to fire the ChallengeHandler before loading anything
_= await PortalItem.CreateAsync(_portal, "itemid");

Map = new Map(new Basemap(BasemapStyle.ArcGISStreetsRelief))
{
	InitialViewpoint = ...
};

_projectsFeatureLayer = new FeatureLayer(new Uri(ProjectsShapeUrl));
_photosFeatureLayer = new FeatureLayer(new Uri(PhotoUrl));

Map.OperationalLayers.Add(_photosFeatureLayer);
Map.OperationalLayers.Add(_projectsFeatureLayer);

await Map.LoadAsync();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will fire the OAuth dialog and the user logs in then everything loads and no APIKey is needed.&lt;/P&gt;&lt;P&gt;The issue is that even though I am logged in and can load layers without issue the _portal object does not seem to hydrate completely.&amp;nbsp; There is no PortalUser on the object, and if I try to get a license it fails saying the user cannot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeHershman_0-1660232833691.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48428iB2CE728C3B09AF15/image-size/large?v=v2&amp;amp;px=999" role="button" title="JoeHershman_0-1660232833691.png" alt="JoeHershman_0-1660232833691.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;According to help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeHershman_1-1660232992492.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48430i58DF7D1856AC4A64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeHershman_1-1660232992492.png" alt="JoeHershman_1-1660232992492.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At this point the user is authenticated because the maps have loaded, load status is Loaded.&amp;nbsp; Also if I try to get a license it fails&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeHershman_2-1660233220567.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48431i91DE2B71F573C61D/image-size/large?v=v2&amp;amp;px=999" role="button" title="JoeHershman_2-1660233220567.png" alt="JoeHershman_2-1660233220567.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which is not true, the user does have access to a Standard Runtime license.&lt;/P&gt;&lt;P&gt;There is nothing I could find, beyond loading a map that would be required for initialization, as described in help.&amp;nbsp; Am I missing something?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/256344"&gt;@MatveiStefarov&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 15:59:03 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2022-08-11T15:59:03Z</dc:date>
    <item>
      <title>Logged in via OAuth, but cannot access portal properties</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/logged-in-via-oauth-but-cannot-access-portal/m-p/1201965#M11256</link>
      <description>&lt;P&gt;After a bit of deliberation I was finally able to get the OAuth credential generation working in a net6 wpf application.&amp;nbsp; See&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-net-questions/challenge-handler-not-called-in-wpf/m-p/1199604#M11212" target="_self"&gt;&amp;nbsp;Challenge Handler not called in WPF&lt;/A&gt;&amp;nbsp;I took a bit of a different approach than discussed there, shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; // Calls await ArcGISPortal.CreateAsync(new Uri(ServerUrl));
_portal = await _authenticationHelper.OpenPortalAsync();

//Done to fire the ChallengeHandler before loading anything
_= await PortalItem.CreateAsync(_portal, "itemid");

Map = new Map(new Basemap(BasemapStyle.ArcGISStreetsRelief))
{
	InitialViewpoint = ...
};

_projectsFeatureLayer = new FeatureLayer(new Uri(ProjectsShapeUrl));
_photosFeatureLayer = new FeatureLayer(new Uri(PhotoUrl));

Map.OperationalLayers.Add(_photosFeatureLayer);
Map.OperationalLayers.Add(_projectsFeatureLayer);

await Map.LoadAsync();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will fire the OAuth dialog and the user logs in then everything loads and no APIKey is needed.&lt;/P&gt;&lt;P&gt;The issue is that even though I am logged in and can load layers without issue the _portal object does not seem to hydrate completely.&amp;nbsp; There is no PortalUser on the object, and if I try to get a license it fails saying the user cannot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeHershman_0-1660232833691.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48428iB2CE728C3B09AF15/image-size/large?v=v2&amp;amp;px=999" role="button" title="JoeHershman_0-1660232833691.png" alt="JoeHershman_0-1660232833691.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;According to help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeHershman_1-1660232992492.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48430i58DF7D1856AC4A64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeHershman_1-1660232992492.png" alt="JoeHershman_1-1660232992492.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At this point the user is authenticated because the maps have loaded, load status is Loaded.&amp;nbsp; Also if I try to get a license it fails&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeHershman_2-1660233220567.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48431i91DE2B71F573C61D/image-size/large?v=v2&amp;amp;px=999" role="button" title="JoeHershman_2-1660233220567.png" alt="JoeHershman_2-1660233220567.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which is not true, the user does have access to a Standard Runtime license.&lt;/P&gt;&lt;P&gt;There is nothing I could find, beyond loading a map that would be required for initialization, as described in help.&amp;nbsp; Am I missing something?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/256344"&gt;@MatveiStefarov&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 15:59:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/logged-in-via-oauth-but-cannot-access-portal/m-p/1201965#M11256</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2022-08-11T15:59:03Z</dc:date>
    </item>
  </channel>
</rss>

