sofyco/facebook-security-voter-bundle
Composer 安装命令:
composer require sofyco/facebook-security-voter-bundle
包简介
Symfony Facebook Security Voter Bundle
README 文档
README
Installation
composer req sofyco/facebook-security-voter-bundle
Configuration
The bundle exposes a facebook_security_voter configuration node with two
required, non-empty string arguments:
secret— Facebook App Secret; verifies thex-hub-signature-256HMAC-SHA256 header onPOSTwebhooks.signature— verify token; verifies thehub_verify_tokenquery parameter onGETverification requests.
# config/packages/facebook_security_voter.yaml facebook_security_voter: secret: '%env(FACEBOOK_APP_SECRET)%' signature: '%env(FACEBOOK_VERIFY_TOKEN)%'
Both options are resolved into the FacebookWebhookVoter constructor
($secret and $signature); the RequestStack argument is autowired.
Usage
The bundle registers a security voter (FacebookWebhookVoter) that grants
access when the current request is a legitimate Facebook webhook call:
GETrequests are validated against thehub_verify_tokenquery parameter;POSTrequests are validated against thex-hub-signature-256HMAC-SHA256 header.
Use the FacebookWebhookVoter::SIGNATURE attribute to protect a controller:
use Sofyco\Bundle\FacebookSecurityVoterBundle\Security\Voter\FacebookWebhookVoter; use Symfony\Component\Security\Http\Attribute\IsGranted; #[IsGranted(FacebookWebhookVoter::SIGNATURE)] public function __invoke(): Response { // ... }
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-01