Is there an ArcGIS Runtime API for getting server info?
Rest endpoint: https://developers.arcgis.com/rest/services-reference/enterprise/server-info.htm
For instance populating Esri.ArcGISRuntime.Security.ServerInfo given the server Uri?Using ArcGIS Runtime 100.15 for .NET
Actually I was thinking of a workaround for AuthenticationManager not providing the correct OAuth authorization URLs.
We have a portal with Azure AD authentication and a federated server.
ArcGIS Server service:https://myserver.company.com/servermm/rest/services/MyService
Federated to portal with AAD auth set up:https://myserver.company.com/portal
IOAuthAuthorizeHandler.AuthorizeAsync gets called with with:serviceUri = https://myserver.company.com/servermm/rest/services/MyServiceauthorizeUri = https://myserver.company.com/servermm/rest/sharing/oauth2/authorizecallbackUri = https://myserver.company.com/servermm/rest/sharing/oauth2/approval
But that doesn't work - since it needs to go via the portal, so it ought to be:authorizeUri = https://myserver.company.com/portal/sharing/oauth2/authorizecallbackUri = https://myserver.company.com/portal/sharing/oauth2/approval
As far as I could see (using ILSpy), AuthenticationManager tries to guess the authorization url, rather than using server info (owning system).I've tried calling AuthenticationManager.Current.RegisterServer(serverInfo) with manually supplied ServerInfo.OwningSystemUri. But I still can't get it working.
So for now I've resorted to patching the authorizeUri and callbackUri so they hit the portal instead, and then it works.
The server info endpoint: https://myserver.company.com/servermm/rest/infoseems to provide the correct/expected owningSystemUrl and tokenServicesUrl values.
I've based the OAuth handler code on an Esri sample:https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/main/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Security/OAuth
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.What is the reason you're needing the server info?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.