Adding username/password to the service call

2 posts, 0 answers
  1. Christopher
    Christopher avatar
    1 posts
    Member since:
    Jan 2013

    Posted 28 Jan 2013 Link to this post

    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?

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 29 Jan 2013 Link to this post

    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.

  3. DevCraft banner
Back to Top