0
我用HWIOauthBundle和FOSUerBunlde用于连接到Twitter,尝试改变CLIENT_ID和client_secret动态,和我的想法不覆盖服务:hwi_oauth.abstract_resource_owner.oauth1,但没有执行覆盖:hwioauth动态CLIENT_ID Symfony2的
我service.yml:
parameters:
my_user_provider.class: Wf\DeckBundle\Security\Core\User\FOSUBUserProvider
services:
my_user_provider:
class: "%my_user_provider.class%"
#this is the place where the properties are passed to the UserProvider - see config.yml
arguments: [@fos_user.user_manager,{twitter: twitterID }]
arguments: [@doctrine.orm.entity_manager]
security_handler: #este no es necesario
class: Company\Bundle\Handler\SecurityHandler
arguments: [@router]
test_service:
class: Wf\DeckBundle\Services\TestService
arguments: ['@service_container']
deck_user_manager:
class: Wf\DeckBundle\Services\DeckUserManager
arguments: [@security.encoder_factory, @fos_user.util.username_canonicalizer, @fos_user.util.email_canonicalizer, @fos_user.entity_manager, Wf\DeckBundle\Entity\User]
twitter_api:
class: Wf\DeckBundle\Services\TwitterService
arguments: [consumerKey,consumerSecret]
deck.user.roles:
class: Wf\DeckBundle\Services\RolesDeckService
arguments: ['%security.role_hierarchy.roles%']
hwi_oauth.abstract_resource_owner.oauth1:
class: Wf\DeckBundle\OAuth\ResourceOwner\GenericOAuth1ResourceOwner
abstract: true
parent: hwi_oauth.abstract_resource_owner.generic
arguments: ['@hwi_oauth.storage.session']
我的课:
<?php
namespace Wf\DeckBundle\OAuth\ResourceOwner;
use HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GenericOAuth1ResourceOwner as Based;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of GenericOAuth1ResourceOwner
*
* @author francisco
*/
class GenericOAuth1ResourceOwner extends Based{
public function getRequestToken($redirectUri, array $extraParameters = array())
{
$timestamp = time();
\Kint::dump($timestamp); // to show pass overwrite
exit;
}
/**
* {@inheritDoc}
*/
}
,但没有工作,谁可以指导我,谢谢
请回答这里的问题,而不是只是链接到另一个网站。其他网址会变得过时,但如果您在此处撰写简洁的答案,它将会很有帮助。 – 2015-07-12 01:38:03
感谢这个链接是完美的。 – ncw2233 2015-12-10 18:48:02
该链接已损坏 – muhsin 2018-02-20 20:33:44