AnsweredAssumed Answered

Using basemaps requiring credentials

Question asked by on Feb 8, 2017
Latest reply on Feb 10, 2017 by

I'm having the darnedest time creating a basemap based on a ArcGISTiledLayer that is coming from a Uri that requires credentials...


So here's what I'm doing:

        CurrentBasemapUrl = ""

      var server = CurrentBasemapUrl; // "";

 Esri.ArcGISRuntime.Security.AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(myChallengeHandler);

 myMap.Basemap = new Basemap(new ArcGISTiledLayer(new Uri(server)));


for myChallengeHandler, I have this:

static async Task<Credential> myChallengeHandler(CredentialRequestInfo cri)
      case AuthenticationType.Token:
      var options = new Esri.ArcGISRuntime.Security.GenerateTokenOptions() { Referer = new Uri(CurrentBasemapUrl)};
      var user = "myusernameishere";
      var pass = "mypasswordishere";
      var cred = await AuthenticationManager.Current.GenerateCredentialAsync(
         new Uri(""),user, pass, options);

      return cred;
   return null;


when I do this, all I get is a grid, no maps. But I'm not getting any errors. Any ideas?


Using the same URL, I was able to successfully download a tile package.


If I change the URL to "" (which doesn't require any creditials, it works fine.


Any help?