<?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: Get Server Info using ArcGIS Runtime in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249551#M11606</link>
    <description>&lt;P&gt;Generally the runtime will auto-discover these for you. The exception is OAuth where you need to provide some of that info up front (like client id etc), but again most of it is loaded for you once you hit that server.&lt;BR /&gt;&lt;BR /&gt;What is the reason you're needing the server info?&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 17:08:58 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2023-01-19T17:08:58Z</dc:date>
    <item>
      <title>Get Server Info using ArcGIS Runtime</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249506#M11605</link>
      <description>&lt;P&gt;Is there an ArcGIS Runtime API for getting server info?&lt;/P&gt;&lt;P&gt;Rest endpoint:&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/server-info.htm" target="_blank" rel="noopener nofollow noreferrer"&gt;&amp;nbsp;https://developers.arcgis.com/rest/services-reference/enterprise/server-info.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance populating Esri.ArcGISRuntime.Security.ServerInfo given the server Uri?&lt;BR /&gt;&lt;BR /&gt;Using ArcGIS Runtime 100.15 for .NET&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 15:48:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249506#M11605</guid>
      <dc:creator>MadsHoumann</dc:creator>
      <dc:date>2023-01-19T15:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get Server Info using ArcGIS Runtime</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249551#M11606</link>
      <description>&lt;P&gt;Generally the runtime will auto-discover these for you. The exception is OAuth where you need to provide some of that info up front (like client id etc), but again most of it is loaded for you once you hit that server.&lt;BR /&gt;&lt;BR /&gt;What is the reason you're needing the server info?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 17:08:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249551#M11606</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2023-01-19T17:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get Server Info using ArcGIS Runtime</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249567#M11607</link>
      <description>&lt;P&gt;Actually I was thinking of a workaround for AuthenticationManager not providing the correct OAuth authorization URLs.&lt;/P&gt;&lt;P&gt;We have a portal with Azure AD authentication and a federated server.&lt;/P&gt;&lt;P&gt;ArcGIS Server service:&lt;BR /&gt;&lt;A href="https://myserver.company.com/servermm/rest/services/MyService" target="_blank"&gt;https://myserver.company.com/servermm/rest/services/MyService&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Federated to portal with AAD auth set up:&lt;BR /&gt;&lt;A href="https://myserver.company.com/portal" target="_blank"&gt;https://myserver.company.com/portal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;IOAuthAuthorizeHandler.AuthorizeAsync gets called with with:&lt;BR /&gt;serviceUri = &lt;A href="https://myserver.company.com/servermm/rest/services/MyService" target="_blank"&gt;https://myserver.company.com/servermm/rest/services/MyService&lt;/A&gt;&lt;BR /&gt;authorizeUri = &lt;A href="https://myserver.company.com/servermm/rest/sharing/oauth2/authorize" target="_blank"&gt;https://myserver.company.com/servermm/rest/sharing/oauth2/authorize&lt;/A&gt;&lt;BR /&gt;callbackUri = &lt;A href="https://myserver.company.com/servermm/rest/sharing/oauth2/approval" target="_blank"&gt;https://myserver.company.com/servermm/rest/sharing/oauth2/approval&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But that doesn't work - since it needs to go via the portal, so it ought to be:&lt;BR /&gt;authorizeUri = &lt;A href="https://myserver.company.com/portal/sharing/oauth2/authorize" target="_blank"&gt;https://myserver.company.com/portal/sharing/oauth2/authorize&lt;/A&gt;&lt;BR /&gt;callbackUri = &lt;A href="https://myserver.company.com/portal/sharing/oauth2/approval" target="_blank"&gt;https://myserver.company.com/portal/sharing/oauth2/approval&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As far as I could see (using ILSpy), AuthenticationManager tries to guess the authorization url, rather than using server info (owning system).&lt;BR /&gt;&lt;BR /&gt;I've tried calling AuthenticationManager.Current.RegisterServer(serverInfo) with manually supplied ServerInfo.OwningSystemUri. But I still can't get it working.&lt;/P&gt;&lt;P&gt;So for now I've resorted to patching the authorizeUri and callbackUri so they hit the portal instead, and then it works.&lt;/P&gt;&lt;P&gt;The server info endpoint: &lt;A href="https://myserver.company.com/servermm/rest/info" target="_blank"&gt;https://myserver.company.com/servermm/rest/info&lt;/A&gt;&lt;BR /&gt;seems to provide the correct/expected owningSystemUrl and tokenServicesUrl values.&lt;/P&gt;&lt;P&gt;I've based the OAuth handler code on an Esri sample:&lt;BR /&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Security/OAuth" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Security/OAuth&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 17:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/get-server-info-using-arcgis-runtime/m-p/1249567#M11607</guid>
      <dc:creator>MadsHoumann</dc:creator>
      <dc:date>2023-01-19T17:37:43Z</dc:date>
    </item>
  </channel>
</rss>

