is there anyway to protect the Bing maps API key from being exposed to the client?
The Bing Maps Routing API enables optimized travel times both for consumers and commercial applications with location intelligence features using historical data.
Since Bing Maps has free and paid versions, the main indication of use to focus on is billable transactions.
Open any web browser on your computer, and go to Bing Maps. Identify a starting location. You can have Bing Maps get your current location, or you can use the search box to set another place on the map. Centering the map to current location—Click the circle target at the top left corner of the maps.
For use with consumer-facing, education, and non-profit applications as well as for internal commercial Windows or Windows Phone applications that qualify for free use. You can start building for free with a Basic key.
Quite simply, no. The client application needs knowledge of the key in order to authenticate with the Bing Maps' servers and, since Javascript code cannot ever be completely obfuscated, it will always be possible for a user to extract your key from the code on the client-side.
There are various methods to obscure your key from human eyes browsing your source code (such as those discussed in the posts listed by Sandeep), but these are effective against only the most casual users - it is a trivial matter to use tools such as Firebug to reveal the key for any user so motivated to do so.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With