Bing maps API key (credentials)

Mohannad Eisa picture Mohannad Eisa · Apr 24, 2012 · Viewed 8k times · Source

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

Answer

Alastair Aitchison picture Alastair Aitchison · Apr 24, 2012

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.