我们正在使用 HWIAuhtBundle 进行身份验证,因此有一个这样的用户提供程序接口:
class OAuthUserProvider implements
UserProviderInterface , OAuthAwareUserProviderInterface
{
...
public function loadUserByUsername($username)
{
...
}
public function loadUserByOAuthUserResponse(UserResponseInterface $response)
{
...
}
}
有没有办法在 OAuthUserProvider 类的方法中访问 config.yml 中指定的参数,例如 facebook 应用程序 ID?
hwi_oauth:
resource_owners:
facebook:
type: facebook
client_id: %fb_app%
或者如何访问ServiceContainer?然后以这种方式获取参数: http://symfony.com/doc/current/components/dependency_injection/parameters.html