<?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 Re: Cannot Generate Identity Credentials for Portal in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341026#M4006</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/4061" target="_blank"&gt;Michael Branscomb&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;Basically the following line of code fails with:&amp;nbsp; &lt;/P&gt;&lt;P&gt;System.Net.WebException: Error: NameResolutionFailure&amp;nbsp; at System.Net.HttpWebRequest.EndGetRequestStream &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var cred = await IdentityManager.Current.GenerateCredentialAsync(
&lt;SPAN&gt;&amp;nbsp; new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fportal.domain.com%2Farcgis%2Fsharing%2Frest" target="_blank"&gt;https://portal.domain.com/arcgis/sharing/rest&lt;/A&gt;&lt;SPAN&gt;"),&lt;/SPAN&gt;
&amp;nbsp; "username",
&amp;nbsp; "password") as ArcGISTokenCredential;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use AGOL then it works.&amp;nbsp; So this works&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var cred = await IdentityManager.Current.GenerateCredentialAsync(
&lt;SPAN&gt;&amp;nbsp; new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmycompany.maps.arcgis.com%2Fsharing%2Frest" target="_blank"&gt;http://mycompany.maps.arcgis.com/sharing/rest&lt;/A&gt;&lt;SPAN&gt;"),&lt;/SPAN&gt;
&amp;nbsp; "user",
&amp;nbsp; "password") as ArcGISTokenCredential;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would be happy to give you the url and a login to our portal to test, I really need to get this working using a hosted Portal not AGOL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:07:03 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2021-12-11T16:07:03Z</dc:date>
    <item>
      <title>Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341021#M4001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to do something (that I think should be) very simple, connect to a Portal from a Runtime application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I run&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TokenCredential credential = await IdentityManager.Current.GenerateCredentialAsync(portalUrl, "username", "password");&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;An exception is thrown, "&lt;STRONG&gt;The token service URL is not set.&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine if I am using a service url&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;TokenCredential credential = await IdentityManager.Current.GenerateCredentialAsync(serviceUrl, "username", "password");&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What I am doing seems to me to be exactly how it is described here &lt;A href="https://developers.arcgis.com/net/desktop/guide/access-the-arcgis-platform.htm#ESRI_SECTION1_5D6CB03F32BE435F99B2BBC5BC48F5A7" title="https://developers.arcgis.com/net/desktop/guide/access-the-arcgis-platform.htm#ESRI_SECTION1_5D6CB03F32BE435F99B2BBC5BC48F5A7"&gt;Access the ArcGIS platform—ArcGIS Runtime SDK for .NET | ArcGIS for Developers&lt;/A&gt;​.&amp;nbsp; But maybe I am missing something.&amp;nbsp; I also tried connecting to our AGOL account and get the same exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2016 19:04:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341021#M4001</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2016-03-24T19:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341022#M4002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What Portal Uri are you using? (for example "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Farcgis.com%2Fsharing%2Frest" rel="nofollow" target="_blank"&gt;https://arcgis.com/sharing/rest&lt;/A&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2016 17:07:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341022#M4002</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2016-03-25T17:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341023#M4003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I use something like, &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fportal.mydomain.com%2Farcgis" rel="nofollow" target="_blank"&gt;https://portal.mydomain.com/arcgis&lt;/A&gt;&lt;SPAN&gt; for our internal portal.&amp;nbsp; This is the same Url I would enter to access to portal in a browser.&amp;nbsp; For trying AGOL I use &lt;/SPAN&gt;&lt;A class="unlinked" title="https://ramtechcorp.maps.arcgis.com/"&gt;https://myorganization.maps.arcgis.com/.&amp;nbsp; This is what it seems the help is telling me&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2016 17:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341023#M4003</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2016-03-25T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341024#M4004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/4061"&gt;Michael Branscomb&lt;/A&gt;​ would you have any ideas what changes I need to make to setup the credentials to Portal correctly?&amp;nbsp; Should I be using a rest api url and not the portal url?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2016 20:12:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341024#M4004</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2016-04-01T20:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341025#M4005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We'll need to see some more code to properly determine what the problem might be, but have you tried using &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;PortalURl&amp;gt;/sharing/rest ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 20:24:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341025#M4005</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2016-04-22T20:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341026#M4006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/4061" target="_blank"&gt;Michael Branscomb&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;Basically the following line of code fails with:&amp;nbsp; &lt;/P&gt;&lt;P&gt;System.Net.WebException: Error: NameResolutionFailure&amp;nbsp; at System.Net.HttpWebRequest.EndGetRequestStream &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var cred = await IdentityManager.Current.GenerateCredentialAsync(
&lt;SPAN&gt;&amp;nbsp; new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fportal.domain.com%2Farcgis%2Fsharing%2Frest" target="_blank"&gt;https://portal.domain.com/arcgis/sharing/rest&lt;/A&gt;&lt;SPAN&gt;"),&lt;/SPAN&gt;
&amp;nbsp; "username",
&amp;nbsp; "password") as ArcGISTokenCredential;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use AGOL then it works.&amp;nbsp; So this works&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var cred = await IdentityManager.Current.GenerateCredentialAsync(
&lt;SPAN&gt;&amp;nbsp; new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmycompany.maps.arcgis.com%2Fsharing%2Frest" target="_blank"&gt;http://mycompany.maps.arcgis.com/sharing/rest&lt;/A&gt;&lt;SPAN&gt;"),&lt;/SPAN&gt;
&amp;nbsp; "user",
&amp;nbsp; "password") as ArcGISTokenCredential;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would be happy to give you the url and a login to our portal to test, I really need to get this working using a hosted Portal not AGOL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:07:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341026#M4006</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T16:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot Generate Identity Credentials for Portal</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341027#M4007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After some help from Mike I was able to find the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another symptom of this issue was that Dashboard application would crash when I tried to connect to our Portal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end this was a configuration issue.&amp;nbsp; Because of how our domain is configured we use an internal DNS.&amp;nbsp; In setting up the public URL for the portal was included in the domain DNS.&amp;nbsp; For some reason even though I use the public URL when setting up Web Adapter for Portal some Portal configuration still points to the internal machine name.&amp;nbsp; This was causing a name conflict and is the source of the error I see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up removing the domain DNS mapping and then going through the setup on our DMZ machine.&amp;nbsp; This got everything to be correctly using only the public name.&amp;nbsp; After that I am able to connect using the API and Dashboard no longer crashes.&amp;nbsp; After that I was able to add the domain mapping back so the other machines only internal to the domain can access using the public URL &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 17:49:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/cannot-generate-identity-credentials-for-portal/m-p/341027#M4007</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2016-05-02T17:49:05Z</dc:date>
    </item>
  </channel>
</rss>

