Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why should I hide "consumer secret"?

I'm currently writing a twitter client using javascript, then found out many people reminded javascript developers about not revealing "consumer secret". But they never said why.

So why is it so important to hide my consumer_secret? If anyone want to show my "via My_App" on his app, making the name My_App more famous, why should I worried about anything? After all, you can't get any useful information out of my consumer_secret, the user information is protected by both https and token_secret.

like image 691
Rufus Avatar asked Apr 07 '12 22:04

Rufus


2 Answers

A malicious developer could create a spam application using your consumer secret. If enough spam accounts are using the spam app Twitter may disable the entire consumer key at which point your entire application will no longer work with Twitter.

like image 99
abraham Avatar answered Nov 14 '22 04:11

abraham


You can think of the consumer secret as a password -- it identifies your client to the server. Anyone with your consumer secret can pretend to be your app.

So you need to keep it secure, and you don't want to "hide" it; you want to encrypt it. This should happen on the server, never in the javascript app that you send to the user.

You can find a lot of helpful information at Google's support page.

like image 2
Adam Liss Avatar answered Nov 14 '22 03:11

Adam Liss