<?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: How To Authenticate to access content in ArcGIS Online in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388587#M4607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eric, try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; AuthenticationManager.Current.ChallengeHandler = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; ChallengeHandler(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;async&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; (info) =&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;await&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; AuthenticationManager.Current.GenerateCredentialAsync(portalUri, UserName, Password);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var portal = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;await&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; ArcGISPortal.CreateAsync(portalUri, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, CancellationToken.None);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for portalUri use: new Uri("&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F%3Cmyname%3E.maps.arcgis.com%2Fhome%2Fwebmap%2Fviewer.html%3Fwebmap%3D%3Cidentifier%3E" rel="nofollow" target="_blank"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;https://&amp;lt;myname&amp;gt;.maps.arcgis.com&lt;/SPAN&gt;&lt;/A&gt;")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2018 21:41:10 GMT</pubDate>
    <dc:creator>TonyWakim</dc:creator>
    <dc:date>2018-03-09T21:41:10Z</dc:date>
    <item>
      <title>How To Authenticate to access content in ArcGIS Online</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388586#M4606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a very simple thing to do, but I did not find any easy information to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have today a Xamarin app that use RuntimeSDK .NET. In this app, I have a MapView control that I initialize with a url that points to a WebMap that I created on my ArcGIS Online portal. The url is something like:&lt;/P&gt;&lt;P&gt;&lt;A href="https://&amp;lt;myname&amp;gt;.maps.arcgis.com/home/webmap/viewer.html?webmap=&amp;lt;identifier&amp;gt;"&gt;https://&amp;lt;myname&amp;gt;.maps.arcgis.com/home/webmap/viewer.html?webmap=&amp;lt;identifier&amp;gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As far as I share to everyone the WebMap and Featured layers that are included in my WebMap, there is no problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I want to secure the access and allow only me as a user for accessing this resource.&lt;/P&gt;&lt;P&gt;I found that I can use this piece of code to give authentication but what to give as ServiceUrl to allow the application to acces my content ? I tried many url, but none worked...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var cred = await AuthenticationManager.Current.GenerateCredentialAsync(new Uri("&lt;A href="https://educos.maps.arcgis.com/arcgis/rest/services"&gt;&amp;lt;ServiceUrl&amp;gt;&lt;/A&gt;"), "&amp;lt;login&amp;gt;", "&amp;lt;password&amp;gt;");&lt;BR /&gt;AuthenticationManager.Current.AddCredential(cred);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help !!! I am a little lost with all (too many) possibilities that are described in the help, but without really samples that correspond to my needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 20:15:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388586#M4606</guid>
      <dc:creator>EricDUCOS1</dc:creator>
      <dc:date>2018-03-09T20:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How To Authenticate to access content in ArcGIS Online</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388587#M4607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eric, try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; AuthenticationManager.Current.ChallengeHandler = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; ChallengeHandler(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;async&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; (info) =&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;await&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; AuthenticationManager.Current.GenerateCredentialAsync(portalUri, UserName, Password);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var portal = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;await&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; ArcGISPortal.CreateAsync(portalUri, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, CancellationToken.None);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for portalUri use: new Uri("&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F%3Cmyname%3E.maps.arcgis.com%2Fhome%2Fwebmap%2Fviewer.html%3Fwebmap%3D%3Cidentifier%3E" rel="nofollow" target="_blank"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;https://&amp;lt;myname&amp;gt;.maps.arcgis.com&lt;/SPAN&gt;&lt;/A&gt;")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 21:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388587#M4607</guid>
      <dc:creator>TonyWakim</dc:creator>
      <dc:date>2018-03-09T21:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How To Authenticate to access content in ArcGIS Online</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388588#M4608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, it seems to work now...first, I only took the GenerateCredentialAsync without the ChallengeHandler that produced an exception...but when the line is called in the contexte of the ChallengeHandler, it works...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Mar 2018 08:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-authenticate-to-access-content-in-arcgis/m-p/388588#M4608</guid>
      <dc:creator>EricDUCOS1</dc:creator>
      <dc:date>2018-03-10T08:41:03Z</dc:date>
    </item>
  </channel>
</rss>

