Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OAuth - embedding client secret in your application?

I'm looking at the oauth implementation twitter proposes here:

https://dev.twitter.com/docs/auth/oauth

and oauth libraries like signpost:

http://code.google.com/p/oauth-signpost/

they both talk about using the client secret during the oauth flow, which means for my client application, I'd need to store the secret in the application itself. This is probably risky as someone could grab the secret out of my app. Are there any methods around storing the secret within my app? Am I misunderstanding the oauth flow?

Thanks

like image 267
user291701 Avatar asked Jul 18 '11 19:07

user291701


1 Answers

There are no ways of storing client credentials in a native or JavaScript application without making them practically public. Also, putting those credentials on a proxy server and having the client talk to the server (so that the credentials are not exposed) doesn't really solve anything either. Now you have a problem of authenticating the client to the proxy.

The right solution is to have special support for native applications provided by the OAuth service. OAuth 2.0 uses pre-registered redirection URIs and other techniques to accomplish a reasonable client identity verification for such clients.

like image 192
Eran Hammer Avatar answered Oct 11 '22 17:10

Eran Hammer