Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bing maps API key (credentials)

is there anyway to protect the Bing maps API key from being exposed to the client?

like image 576
Mohannad Eisa Avatar asked Apr 24 '12 12:04

Mohannad Eisa


People also ask

Does Bing Maps have an API?

The Bing Maps Routing API enables optimized travel times both for consumers and commercial applications with location intelligence features using historical data.

Can I use Bing Maps for free?

Since Bing Maps has free and paid versions, the main indication of use to focus on is billable transactions.

How do I connect to Bing Maps?

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.

Can I use Bing Maps commercially?

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.


1 Answers

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.

like image 199
Alastair Aitchison Avatar answered Oct 26 '22 13:10

Alastair Aitchison