Get Server Info using ArcGIS Runtime

01-19-2023 07:48 AM
New Contributor II

Is there an ArcGIS Runtime API for getting server info?

Rest endpoint: 

For instance populating Esri.ArcGISRuntime.Security.ServerInfo given the server Uri?

Using ArcGIS Runtime 100.15 for .NET

Tags (2)
0 Kudos
2 Replies
Esri Notable Contributor

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?

0 Kudos
New Contributor II

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:

Federated to portal with AAD auth set up:

IOAuthAuthorizeHandler.AuthorizeAsync gets called with with:
serviceUri =
authorizeUri =
callbackUri =

But that doesn't work - since it needs to go via the portal, so it ought to be:
authorizeUri =
callbackUri =

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:
seems to provide the correct/expected owningSystemUrl and tokenServicesUrl values.

I've based the OAuth handler code on an Esri sample:

0 Kudos