You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by bilbosax <wa...@comcast.net> on 2020/12/11 22:19:06 UTC

Hide Google API Key

I have 3 mobile apps and 3 desktop apps that use a Google Maps API Key. If
these were to end up in the wild, it could cost me a pretty penny, and they
are very easy to find. The problem is that they are very visible in a simple
Google Maps html file that is in my local store directory. The HTML file has
to be in that directory for my webview to be able to use it, so somehow I
have to be able to hide the key and not the HTML file.

My first thought was to download the key from my database, and somehow
inject it into my HTML file, but I have no clue how to "inject" a variable
into my HTML. Plus, I would rather not write the key to my html file and
save it on the computer. I wish I were able to figure out a way to "include"
an external variable into my HTML, or use an environmental variable.

Has anyone else ran into a similar problem and have any suggestions as to
how I might handle this?



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Hide Google API Key

Posted by bilbosax <wa...@comcast.net>.
I think I found an acceptable solution.  The webView ANE that I use allows me
to talk with Javascript.  So I download the Google API key from my database,
pass it to the maps HTML file through Javascript, and everything works
great.  This way, my API key is never in any files on my users device.  If
somehow somebody ever actually got my API key, I could roll it over to a new
one, but my apps would not break.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/