Dannyl
Dannyl

Reputation: 19

How to hide developer key

I'm working on a personal project to write an app that syncs with a free web service. They have a free API to let third parties connect and both retrieve information, as well as control the accounts themselves.

This is all fine and good but in order to do so, all apps need to be registered on their site for a developer key. This is a static key that allows my app to connect and perform actions.

But that is the rub; I would like to make this an open source app but that would reveal my developer key to anyone who downloads and looks at the code.

Is there a way to hide this key; to keep the source open but not make the key public?

Upvotes: 0

Views: 128

Answers (1)

Belogix
Belogix

Reputation: 8147

One possible solution would be to write a web service / API of your own. In there you store your API key to the other third-party service. Then, in your open-source app you would make a call to YOUR service which in turn uses the stored (and never revealed) API key to communicate to the third-party.

This will keep your key private and as you are making external calls from your app anyway this should not matter. It also has the added advantage that you control whole ecosystem rather than people making direct call to the third-party.

The down-side? Well, it won't be fully open-source but it is probably as close as you will be able to get while keeping some of it private.

Upvotes: 1

Related Questions