<?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 https://www.arcgis.com/sharing/rest error 400 in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/https-www-arcgis-com-sharing-rest-error-400/m-p/137817#M1552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on the tutorial "Author, edit, and save maps to your portal" at&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/latest/wpf/guide/author-edit-and-save-maps-to-your-portal.htm"&gt;https://developers.arcgis.com/net/latest/wpf/guide/author-edit-and-save-maps-to-your-portal.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get to the point where I want to save my map in the instruction: "When you click &lt;SPAN&gt;Save Map to Portal&lt;/SPAN&gt;, a dialog should appear prompting you to sign in to ArcGIS Online."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Invalid redirect_uri&lt;/H3&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Error: &lt;/STRONG&gt;400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the statements in my C# code that throws this error are ( second line throws the error):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;// Indicate the url (portal) to authenticate with (ArcGIS Online)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; challengeRequest.ServiceUri = &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; &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas; font-size: small;"&gt;Uri&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com%2Fsharing%2Frest" rel="nofollow" target="_blank"&gt;https://www.arcgis.com/sharing/rest&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;// Call GetCredentialAsync on the AuthenticationManager to invoke the challenge handler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;await&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas; font-size: small;"&gt;AuthenticationManager&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;.Current.GetCredentialAsync(challengeRequest, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;false&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;I have properly registered my app and am using my own client ID :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;// Client ID for the app registered with the server (Portal Maps)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;const&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; AppClientId = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;"XXXXXXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Please help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Len Hannam&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 May 2017 19:53:33 GMT</pubDate>
    <dc:creator>LenHannam</dc:creator>
    <dc:date>2017-05-18T19:53:33Z</dc:date>
    <item>
      <title>https://www.arcgis.com/sharing/rest error 400</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/https-www-arcgis-com-sharing-rest-error-400/m-p/137817#M1552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on the tutorial "Author, edit, and save maps to your portal" at&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/latest/wpf/guide/author-edit-and-save-maps-to-your-portal.htm"&gt;https://developers.arcgis.com/net/latest/wpf/guide/author-edit-and-save-maps-to-your-portal.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get to the point where I want to save my map in the instruction: "When you click &lt;SPAN&gt;Save Map to Portal&lt;/SPAN&gt;, a dialog should appear prompting you to sign in to ArcGIS Online."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Invalid redirect_uri&lt;/H3&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Error: &lt;/STRONG&gt;400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the statements in my C# code that throws this error are ( second line throws the error):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;// Indicate the url (portal) to authenticate with (ArcGIS Online)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; challengeRequest.ServiceUri = &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; &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas; font-size: small;"&gt;Uri&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com%2Fsharing%2Frest" rel="nofollow" target="_blank"&gt;https://www.arcgis.com/sharing/rest&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;// Call GetCredentialAsync on the AuthenticationManager to invoke the challenge handler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;await&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas; font-size: small;"&gt;AuthenticationManager&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;.Current.GetCredentialAsync(challengeRequest, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;false&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;I have properly registered my app and am using my own client ID :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;// Client ID for the app registered with the server (Portal Maps)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;const&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; AppClientId = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;"XXXXXXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Please help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Len Hannam&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 19:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/https-www-arcgis-com-sharing-rest-error-400/m-p/137817#M1552</guid>
      <dc:creator>LenHannam</dc:creator>
      <dc:date>2017-05-18T19:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: https://www.arcgis.com/sharing/rest error 400</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/https-www-arcgis-com-sharing-rest-error-400/m-p/137818#M1553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Len,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code, whatever url you are using for the constannt variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; private const string OAuthRedirectUrl = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmyapps.portalmapapp" rel="nofollow" target="_blank"&gt;http://myapps.portalmapapp&lt;/A&gt;&lt;SPAN&gt;"; &amp;nbsp;//your ArcGIS online organization url&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;you need to add the same url in the Redirect Uri of the App's "Registered info". It work for me. Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nagma&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/354307_AppIDRegisteredInfo.PNG" style="width: 620px; height: 475px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2017 00:33:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/https-www-arcgis-com-sharing-rest-error-400/m-p/137818#M1553</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2017-05-29T00:33:54Z</dc:date>
    </item>
  </channel>
</rss>

