LoginSignup
1
1

More than 5 years have passed since last update.

Facebookアプリのappsecret_proofの生成手順

Last updated at Posted at 2018-09-18

appsecret_proof の説明

グラフAPIコールは、クライアントから、またはクライアントの代わりにサーバーから実行できます。 サーバーからの呼び出しは、appsecret_proofと呼ばれるパラメーターを追加することによって、セキュリティを強化できます。
Graph APIリクエストの保護 - グラフAPI

生成方法

Railsでの呼び出し例。Macのターミナルでsha256のハッシュを生成する。

$ rails console
OpenSSL::HMAC.hexdigest('sha256', [app_secret], [app_access_token])
=> "xxxxxxxxxxxxxx|yyyyyyyyyyyyyyyyyyyyyyyyyyyy"

ドキュメントにはPHPでの呼び出し記述例あり。

$appsecret_proof= hash_hmac('sha256', $access_token, $app_secret); 

Graph APIリクエストの保護 - グラフAPI

参考

Facebookアプリのapp secretの確認方法 - Qiita
Facebookアプリのapp_access_tokenの生成手順 - Qiita

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1