This is a migrated thread and some comments may be shown as answers.

Adding username/password to the service call

1 Answer 76 Views
Map
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 28 Jan 2013, 04:13 PM

Hi,
we get the map-url by using an object, which extends the TiledMapSource object by Telerik, and its GetTile()-method.


protected override Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)
 {
   int zoomLevel = this.ConvertTileToZoomLevel(tileLevel);
   String url = String.Format(@"http://{0}:{1}/WMS/GetTile/xmap-ajaxbg/{2}/{3}/{4}.png", m_MapProviderSettings.URL,     
   m_MapProviderSettings.Port, tilePositionX, tilePositionY, zoomLevel);    
   url = ProtocolHelper.SetScheme(url);
   return new Uri(url);  
  }

 

We have a map provider that is hosted by a Microsoft cloud, we have to authenticate by a username and password.

We tried to add the username and password to the url string:

String url = String.Format(@"https://USERNAME:PASSWORD@{0}:{1}/WMS/GetTile/xmap-ajaxbg/{2}/{3}/{4}.png", m_MapProviderSettings.URL, m_MapProviderSettings.Port, tilePositionX, tilePositionY, zoomLevel);

   

…but the login failed.


For calling other services in the cloud we have to set the credentials at the service proxy.

Proxy.Credentials = new NetworkCredential(Username, Password);
Is there any way to add the needed login data to the service call?

Regards,
Christopher

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 29 Jan 2013, 01:02 PM
Hi Christopher,

The RadMap control for Silverlight uses standard MultiScaleImage control. Unfortunately this control has no built-in support for any kind of authentication. If your Silverlight application also comes from this site, you can try to configure authentication for the whole project.

Another approach that you can use is try to configure your application to use signature based authentication (cookieless). I.e. your application should login to the server, obtain session signature and then use it in the URI to access the tiles.

All the best,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Map
Asked by
Christopher
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or