Select to view content in your preferred language

Mixing OAuth and ApiKey and SearchView

315
7
4 weeks ago
Labels (2)
JoeHershman
MVP Alum

Hi,

I am really struggling with how one can use the SearchView in the toolkit on an ArcGIS Enterprise 11.1 portal.  I am still at 200.6 for Mobile API and Toolkit.

The problem is that the authentication does not seem to recognize that a logged in user can use location services.  I have set in Portal the Configure utility services to use a AGOL user (user is a Creator/Admin).  I can use the search in a web map and do a location search which works.

However, when I open the map with the SearchView it will prompt for a login.  If I try to enter my portal user, it will fail and ask again.  I have logging so I can see that it is the geocode service Url that is requesting authentication.  But it does not recognize the portal user as having permission.  This makes the SearchView unusable. 

I have developed logic to read the Web Map configuration and create and add ISearchSource objects for each layer.  Which works really well, but this permission to use locator is making it not useable as a search tool

Thanks,
-Joe
0 Kudos
7 Replies
dotMorten_esri
Esri Notable Contributor

The title seem to suggest you're also using API Key. If you're using a signed in user, do not set the API Key. It's an either/or kind of thing.

0 Kudos
JoeHershman
MVP Alum

I apologize for being unclear.  I am not using an ApiKey if the user logs on.  If they log in to ArcGIS Enterprise I do not set an ApiKey.

When a user connects using this approach, when the Map opens with the SearchView an authentication is requested (i.e., ChallengeHandler invoked).  The ServiceUri in the challenge is for the Geocoding Url.

 

I did try using an ApiKey when the user does not log in via OAuth (SAML).  Search works fine in this scenario.  The user of course cannot sync, but search works fine because layer searches are offline and the ApiKey works for Geocoding Url.

Thanks,
-Joe
0 Kudos
dotMorten_esri
Esri Notable Contributor

Does the user you sign in with have permission/access to use the world geocoder?

0 Kudos
JoeHershman
MVP Alum

I setup the AGO World Geocoder using am admin user on the AGOL side.  I setup (and shared) but if my user connects or other ArcGIS Enterprise admin users we are seeing the issue

Thanks,
-Joe
0 Kudos
dotMorten_esri
Esri Notable Contributor

Also are you able to try v200.7? I believe there were some fixes that could have addressed this.

0 Kudos
JoeHershman
MVP Alum

I have tried using an upgrade to 200.7 and it still gives me the same issue.  If I am logged in to ArcGIS Enterprise it will go into the ChallengeHandler with this Url:

https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer

when the search bar is loaded.  Entering credentials does nothing, it just loops through the ChallengeHandler over and over until I cancel and then there is no address search

I think we have things setup correct in ArcGIS Enterprise, but if there is a guide that shows specifics I would be happy to review.  We are able to do an address search from a WebMap

 

Thanks,
-Joe
0 Kudos
JoeHershman
MVP Alum

I am working through some other issues that have prevented us from upgrading

Thanks,
-Joe
0 Kudos