×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Distance calculator - Google API

Distance calculator - Google API

Distance calculator - Google API

(OP)
Hi,
The code provided bij Mike Gagnon Link needs now an Google APIKey.
This Key is easy to obtain from Google, but how to implent in the code?
Regards,
Koen

RE: Distance calculator - Google API

You're asking how to keep this key secret, right?

Read this discussion: https://softwareengineering.stackexchange.com/ques...
The conclusion is you better not embed this directly into a VFP executable. Because in the end Fiddler added as a proxy can record HTTP traffic, even HTTPS.

The solution is to have your own proxy on an own domain in conjunction with using Googles own key management mechanisms to restrict key usage from one domain only, your proxy service domain.

Now the problem only seems to be shifted, as your own domain needs to act as a proxy between your EXE which means now your domain is becoming the target, anyone could use your key by using your proxy. You have some advantages, even though the communication of your EXE with your proxy can still be eavesdropped on. Your proxy may only support part of the functionality and using it only gives an attacker the ability to use the rate limit. It already is far less interesting. Besides, as long as you only use what you get free by using a free key, that key is not really valuable for neither you nor Google nor others, as everyone can get free keys.

And aside of that with your own proxy, the part of the communication between your EXE and your proxy is totally up to you, you can sign every request with one time keys or do whatever you want that makes eavesdropping on this communication useless. The part of the communication between your proxy and Google is protected by the Google API key restriction, your domain bound key is useless for others, and you should trust your hoster enough both to protect your server-side code and not use keys deposited there themselves.

Bye, Olaf.


Olaf Doschke Software Engineering
https://www.doschke.name

RE: Distance calculator - Google API

(OP)
Hi Olaf,
No I was not asking to keep this KEY secret, I was asking how to implant the KEY into the coding

CODE --> vfp

lcFullURL = "http://maps.googleapis.com/maps/api/directions/xml?" + m.lcRouteParameters + ;
"&units=metric&sensor=false" &&+ m.tlShowRouteDetails 
If I simply replace the directory api in this URL with my KEY - error
For your info I am implanting this into an application which I constructed for my own private use, no way to send it to others.
Regards,
Koen

RE: Distance calculator - Google API

(OP)
Olaf,
Thanks for the link.
Regards,
Koen

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close