4

Facebook oAuth requires your secret key? I thought you weren't supposed to share that. Am I using the wrong secret key?

2
  • Is this really a programming question?
    – MJB
    Jun 11, 2010 at 17:55
  • 2
    Yes... its program related anyway
    – MgS
    Jun 11, 2010 at 17:57

4 Answers 4

1

Your secret key is a shared secret between you and Facebook. Thus you can send it over secure channels (such as SSL)

0

Are you talking about when your program requests an access token? If so, you need to supply the secret you're going to be using so it can be known by Facebook and associated with the access token they're issuing to you. Once you have your access token, you shouldn't have to send your secret to Facebook anymore...just use it to hash your API requests.

0

The api keys reside in php and you are not supposed to print them anywhere. Just use them to initialize the php facebook api. Here is tutorial i have written to write Facebook apps.

http://www.dreamincode.net/forums/topic/153919-facebook-php-api-and-xfbml-on-iframe/

0

The answer is, it depends. My understanding is that you are asking about the client_secret or app_secret.

If you are doing server side connection to Facebook, then you use the client_secret. This is the authorization grant type of the oauth protocol.

If you are doing client side connection to Facebook, you don't want to include the client_secret as your code can be decompiled and others can access it, and start interacting with facebook using your credentials. In this instance, you are using the implicit grant type of the oauth protocol. Facebook does not require the client secret in this instance, and in fact, their security page checklist says never to include the client secret: https://developers.facebook.com/docs/facebook-login/security#checklist

The best (opinion) run down on oauth from a conceptual perspective (rather than nitty gritty code) that I've found is here: https://stormpath.com/blog/what-the-heck-is-oauth (I have no association, just like this page).

Hope this helps, D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.