GithubHelp home page GithubHelp logo

friendsofsymfony / fostwitterbundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kriswallsmith/twitterbundle

146.0 146.0 38.0 289 KB

UNMAINTAINED. Please use HWIOAuthBundle as a replacement for FOSTwitterBundle.

Home Page: http://friendsofsymfony.github.com/

PHP 100.00%

fostwitterbundle's People

Contributors

arghav avatar bamarni avatar carlossg00 avatar gigo6000 avatar koc avatar kriswallsmith avatar lenar avatar lmcd avatar lsmith77 avatar merk avatar schmittjoh avatar seldaek avatar sescandell avatar stof avatar travib avatar xosofox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fostwitterbundle's Issues

OAuth still using 1.0 api URLs even though they are deprecated

Perhaps I am missing something but the kertz/twitteroauth library this bundle uses is still using the twitter 1.0 api calls. These stopped working as of today.

The original abraham/twitteroauth library is updated (the kertz fork no longer seems to be maintained). Is it possible to switch to that?

screen name instead of user id

I use a custom provider as described in the documentation, and there is a problem with this function :
public function loadUserByUsername($username)
The problem is that (despite it's name) $username should be the twitter user id, because the rest of the code waits for it, and because the user can change its screen name in twitter, so the twitter id is the only reliable username.

Line 95 of Security / Authentication / Provider / TwitterProvider.php
$user = $this->userProvider->loadUserByUsername($accessToken['screen_name']);

I'm new to this module but I suppose we need to change this line.

Identity cookie "twitter_anywhere_identity" was not sent (v1.0.0) Webkit

Hi, I am using twitter anywhere.

The config.yaml contains the "use_twitter_anywhere: true"

Everything is working except in webkit where the cookie is never write.
After some search it seems Chrome and safari won't create the cookie for security reason and after redirect it return me
error: Identity cookie "twitter_anywhere_identity" was not sent

Is that a know issue ?
Can you suggest me solution ?

Thanks for your help.

multiple authentication providers

Hi i use TwitterBundle, FacebookBundle and UserBundle in my application and try to put together this 3 authentication mechanisms, but only get the entry point of the firewall the first i set in my security configuration, so i implement a fix or workaround to this problem. Here is the solution i found:

Before:

TwitterListener.php

/**

  • Twitter authentication listener.
    */
    class TwitterListener extends AbstractAuthenticationListener
    {
    protected function attemptAuthentication(Request $request)
    {
    if (true === $this->options['use_twitter_anywhere']) {
    if (null === $identity = $request->cookies->get('twitter_anywhere_identity')) {
    throw new AuthenticationException(sprintf('Identity cookie "twitter_anywhere_identity" was not sent.'));
    }
    if (false === $pos = strpos($identity, ':')) {
    throw new AuthenticationException(sprintf('The submitted identity "%s" is invalid.', $identity));
    }

        return $this->authenticationManager->authenticate(TwitterAnywhereToken::createUnauthenticated(substr($identity, 0, $pos), substr($identity, $pos + 1)));
    } else {
        return $this->authenticationManager->authenticate(new TwitterUserToken());
    }
    

    }
    }
    After:

/**

  • Twitter authentication listener.
    */
    class TwitterListener extends AbstractAuthenticationListener
    {
    protected function attemptAuthentication(Request $request)
    {
    if($request->getSession()->get("oauth_token", null) && $request->get("oauth_token", null) &&
    $request->getSession()->get("oauth_token", null) === $request->get("oauth_token", null))
    {
    if (true === $this->options['use_twitter_anywhere']) {
    if (null === $identity = $request->cookies->get('twitter_anywhere_identity')) {
    throw new AuthenticationException(sprintf('Identity cookie "twitter_anywhere_identity" was not sent.'));
    }
    if (false === $pos = strpos($identity, ':')) {
    throw new AuthenticationException(sprintf('The submitted identity "%s" is invalid.', $identity));
    }

          return $this->authenticationManager->authenticate(TwitterAnywhereToken::createUnauthenticated(substr($identity, 0, $pos), substr($identity, $pos + 1)));
      } else {
          return $this->authenticationManager->authenticate(new TwitterUserToken());
      }
    }
    return null;
    

    }
    }

If there is another way to doit please answer me, thanks.

I will be very glad if TwitterBundle developers fix this issue and get the code merge into the branch.

Fix to issue with Twitter Authentication

Hi there, I installed FOSTwitterBundle 1.0 and integrated with FOSFacebookBundle and FOSUserBundle.

I had an issue when authenticating with Twitter :-

"there is no provider for 'Acme\MyUserBundle\Entity\User'"

I have done lots of debugging and found that the issue was that the twitterID was not being serialized with the User when the Token was serialized. I fixed the problem using the same method as FOSFacebookBundle used, you must make sure that you have a serialize() and unserialize() function which preserves the twitterID :-

public function serialize()
{
    return serialize(array($this->facebookId, $this->twitterID, parent::serialize()));
}

public function unserialize($data)
{
    list($this->facebookId, $this->twitterID, $parentData) = unserialize($data);
    parent::unserialize($parentData);
}

Hope this helps someone!

Thanks for the bundles :-)

Lev

attemptAuthentication is silent

Hello,

I'm trying to use @Anwywhere auth and its not working :

When I go to my login_check page - after clicking on the Connect button - I get a blank page ( on the facebook bundle I had errors there ) so I ended up debugging it and here : https://github.com/FriendsOfSymfony/FOSTwitterBundle/blob/v1.0/Security/Firewall/TwitterListener.php#L28 the Exception is silent.

And I don't know why Identity cookie "twitter_anywhere_identity" was not sent.

Thanks for your advices :)

Twig Extension : Bad overrided function

Switching to Twig 1.8.0, I got the following error :

Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Catchable Fatal
Error: Argument 2 passed to Twig_Environment::addFunction() must implement interface
Twig_FunctionInterface, instance of Twig_Filter_Method given, called in /data/projets/project/source/trunk
/vendor/twig/lib/Twig/Environment.php on line 962 and defined in /data/projets/project/source/trunk/vendor
/twig/lib/Twig/Environment.php line 895") in "ProjectCoreBundle::layout.html.twig".

Exploring the code, I see in TwitterAnywhereExtension class you override the function "getFunctions()" in order to return an array of Twig_Filter_Method objects. I think the right function to override is "getFilters()" instead.

Twitter anywhere helper, function initialize() JS error.

On IE, the function initialize(); return the configMap php var to twig.

After the creation of configMap:

foreach ($this->config as $key => $value){
    $configMap .= $key.": ".$value.',';
}

We must rtrim the var, to delete last coma.

foreach ($this->config as $key => $value){
    $configMap .= $key.": ".$value.',';
}
$configMap = rtrim($configMap,',');

If we do not do that, there is an error on IE.

InvalidArgumentException: There is no extension able to load the configuration for "my.twitter.user"

Hi, sorry for the title but i thought it was the best way to explain my issue.

I've followed all your readme and installation guide, but i got an issue with the namespace my.twitter.user on the config.yml. It seems like it can be recognized, but it's defined as provider in the security.yml.

Everything works well before i did the last part. So I think it's goodin the appKernel and I already use the FOSUserBundle.

Do you know why do I got that kind of issue ?

Thanks a lot

loadUserByUsername or by id ?

In the TwitterUserProvider there's a

 public function loadUserByUsername($username)

which have a $username parameter.

But it is sometimes called with

 return $this->loadUserByUsername($user->getTwitterID()); // TwitterUserProvider.php

and sometimes

 $user = $this->userProvider->loadUserByUsername($accessToken['screen_name']); // vendor\friendsofsymfony\twitter-bundle\FOS\TwitterBundle\Security\Authentication\Provider\TwitterProvider.php

There must be something I don't understand.

Impossible to Write Extension to fos_twitter.auth

I might be going at this wrong, so please help me out if i'm completely lost.

I wanted to pass on a custom UserProvider to the fos_twitter.auth service (the 3rd parameter). I found no way to do this using the configuration, so wrote a custom service which basically extends the TwitterProvider and instantiates a new UserProvider and passes it on to the FOS TwitterProvider constructor.

I altered the security config to :

providers:
     twitter:
         id: phpsp.twitter.auth

Problem is the Factory forces the use of the .auth service on line 76 in the createAuthProvider function. This is because this is hardcoded to point to fos_twitter.auth.

This caused me to have 2 instances of the Provider and the wrong one to be used on authentication. Changing that line 76 to point to my service did the trick, so i wonder if this should read form config instead of hardcoding itself? or maybe i just went about everything wrong.

Wrong parameters for Exception

After Twitter redirects me to the check path, I get a fatal error stating, "Wrong parameters for Exception". Here is the stack trace.

FatalErrorException: Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /var/www/vendor/friendsofsymfony/twitter-bundle/FOS/TwitterBundle/Security/Authentication/Provider/TwitterProvider.php line 77

in /var/www/vendor/friendsofsymfony/twitter-bundle/FOS/TwitterBundle/Security/Authentication/Provider/TwitterProvider.php line 77
at ErrorHandler->handleFatal() in /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php line 0
at Exception->__construct('', '', '', '') in /var/www/vendor/friendsofsymfony/twitter-bundle/FOS/TwitterBundle/Security/Authentication/Provider/TwitterProvider.php line 77
at TwitterProvider->authenticate('token' => '') in /var/www/app/cache/dev/classes.php line 4186
at AuthenticationProviderManager->authenticate('token' => '') in /var/www/vendor/friendsofsymfony/twitter-bundle/FOS/TwitterBundle/Security/Firewall/TwitterListener.php line 45
at TwitterListener->attemptAuthentication('request' => '') in /var/www/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php line 136
at AbstractAuthenticationListener->handle('event' => '') in /var/www/app/cache/dev/classes.php line 4063
at Firewall->onKernelRequest('event' => '') in /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 451
at ??call_user_func('', '') in /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 451
at TraceableEventDispatcher->Symfony\Component\HttpKernel\Debug\{closure}('event' => '') in /var/www/app/cache/dev/classes.php line 3403
at ??call_user_func('', '') in /var/www/app/cache/dev/classes.php line 3403
at EventDispatcher->doDispatch('listeners' => '', 'eventName' => '', 'event' => '') in /var/www/app/cache/dev/classes.php line 3336
at EventDispatcher->dispatch('eventName' => '', 'event' => '') in /var/www/app/cache/dev/classes.php line 3500
at ContainerAwareEventDispatcher->dispatch('eventName' => '', 'event' => '') in /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 139
at TraceableEventDispatcher->dispatch('eventName' => '', 'event' => '') in /var/www/app/bootstrap.php.cache line 992
at HttpKernel->handleRaw('request' => '', 'type' => '') in /var/www/app/bootstrap.php.cache line 977
at HttpKernel->handle('request' => '', 'type' => '', 'catch' => '') in /var/www/app/bootstrap.php.cache line 1103
at ContainerAwareHttpKernel->handle('request' => '', 'type' => '', 'catch' => '') in /var/www/app/bootstrap.php.cache line 413
at Kernel->handle('request' => '', 'type' => '', 'catch' => '') in /var/www/web/app_dev.php line 27
at ??{main}() in /var/www/web/app_dev.php line 0

This is with Symfony 2.2.2, FOSTwitterBundle dev-master.

Save user information in database using FOSTwitterBundle

I installed FOSTwitterBundle using your tutorial here ,but I have an issue about how to save informations in my database of every user logged using his twitter account ?

I have this error :
_ErrorException: Catchable Fatal Error: Argument 2 passed to Skeleton\PanelBundle\Security\User\Provider\TwitterUserProvider::_construct() must be an instance of FOS\UserBundle\Entity\UserManager, instance of FOS\UserBundle\Doctrine\UserManager given, called in /var/www/skeleton/app/cache/dev/appDevDebugProjectContainer.php on line 1678 and defined in /var/www/skeleton/src/Skeleton/PanelBundle/Security/User/Provider/TwitterUserProvider.php line 34

here is my config.yml :

*services:
my.twitter.user:
class: Skeleton\PanelBundle\Security\User\Provider\TwitterUserProvider
arguments:
twitter_oauth: "@fos_twitter.api"
userManager: "@fos_user.user_manager"
validator: "@validator"
session: "@session" *

and security.yml :

*security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext

role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

providers:

my_fos_twitter_provider:
    id: my.twitter.user 

firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false

public:
    pattern:  /
    fos_twitter:
        login_path: /twitter/login
        check_path: /twitter/login_check
        default_target_path: /
        provider: my_fos_twitter_provider

    anonymous: ~* 

I spend almost all day but no solution!

twitter cookie is not set

Hi,

when i try to login into my application with twitter and combine this with custom user provider , i'd this error "twitter_anywhere_identity" is not sent!! wich means that it throws the exception in where identity is empty !!
For information, i use the connexion with a callbackURL for localhost.

Anyone have idea how to resolve this please!

Does this bundle still maintained?

I can see that the last commit is from 3 months ago so I'm not sure if this bundle is still in use or not. Also in the readme it's talking about twitter anywhere that has been discontinued since march.

Is there any reason why this bundle is so out of date? maybe there is brand new one?

Thanks to the answers

UPDATE
After reading some to the issue @stof recommend to use https://github.com/hwi/HWIOAuthBundle and deprecate this bundle. I hope this will save some of your time ;)

Logout does not logout

Accessing /logout is not causing the token to be removed, when redirected back i still hold the same token with my twitter UID

This is my config

security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    factories:
        - "%kernel.root_dir%/../vendor/bundles/FOS/TwitterBundle/Resources/config/security_factories.xml"

    providers:
        fos_twitter:
            id: phpsp.twitter.auth

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false
        secured:
            pattern:    ^/
            anonymous: ~
            fos_twitter: true
            logout: ~

    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: IS_AUTHENTICATED_FULLY }

i wrote a wrapper to the provider, which basically adds a UserProvider, but it was still not working before this. Also i can't seem to make my custom user provider talk to your service.

Pivate properties and no getter in Twitter class

Hi,

Is there any good reasons to have only private properties in the Twitter service class?

I would like to extend it to make my own Twitter service class and have access to the oAuth object. But as it's private... it's dead!

twitter provider error

Hi,
I integrated FOSUserBundle, FOSFacebookBundle, FOSMessageBundle and it was ok!
Now I'm integrating FOSTwitterBundle together without twitter anywhere and I have this problem:

ErrorException: Catchable Fatal Error: Argument 2 passed to project\UserBundle\Security\User\Provider\TwitterProvider::__construct() must be an instance of FOS\UserBundle\Entity\UserManager, instance of FOS\UserBundle\Doctrine\UserManager given, called in /Applications/MAMP/htdocs/project/app/cache/dev/appDevDebugProjectContainer.php on line 2085 and defined in /Applications/MAMP/htdocs/project/src/project/UserBundle/Security/User/Provider/TwitterProvider.php line 25

What's the solution?

Another question...
I read FOStwitterBundle documentation and it says:

//app/security.yml public: pattern: /.* anonymous: true fos_twitter: true logout: true and //app/security.yml public: pattern: / fos_twitter: login_path: /twitter/login check_path: /twitter/login_check default_target_path: / provider: my_fos_twitter_provider anonymous: ~

Which is the right way?

Many thanks!!

Load existing user and connect to twitter account using twitter account data after authorization

On your documentation we can see:

namespace MyApp\MyBundle\Security\User\Provider;
class TwitterProvider implements UserProviderInterface
{

[...]

public function findUserByTwitterId($twitterID)
    {   
        return $this->userManager->findUserBy(array('twitterID' => $twitterID));
    }   

    public function loadUserByUsername($username)
    {
        $user = $this->findUserByTwitterId($username);

[...]

To permit association between logged user and authorized user on twitter I have changed code:
[...]

public function findUserByTwitterId($username)
    {   
        return $this->userManager->findUserBy(array('twitter_username' => $username));
    }

[...]
because at this moment in the workflow we manage the twitter_username instead of twitter_id

Fatal Error when user login twitter account and redirected back to website

Receiving following error when afterlogin twitter account:
Fatal error: Call to undefined method TwitterOAuth::setOAuthToken() in C:\wamp\www\Symfony\vendor\bundles\FOS\TwitterBundle\Services\Twitter.php on line 70

My firewall setting is:

    secured_area:
        fos_facebook:
            app_url: "https://apps.facebook.com/ymmudab"
            server_url: "http://localhost:78/Symfony/web/app_dev.php/"
            login_path: facebook_login
            check_path: facebook_login_check
            provider: my_fos_facebook_provider
            default_target_path: welcome
        fos_twitter:
            login_path: twitter_login
            check_path: twitter_login_check
            default_target_path: welcome
            provider: my_fos_twitter_provider
        form_login:
            login_path: twitter_login
            check_path: twitter_login_check
            provider: user_db
            default_target_path: welcome
        logout:
            path:   logout
            target: /
            handlers: ["fos_facebook.logout_handler"]
        anonymous: ~

I am using Abrahma's twitter library.Please advice.

Invalid / expired Token

Hello,

When the user is redirected to the website, i got an "AuthenticationException: Unknown error". The error is located in : FOS\TwitterBundle\Services\Twitter.php

In getAccessToken() , $accessToken is not checked. And it's occures that $accessToken returns "Invalid / expired Token".
$session->set('access_token', $accessToken['oauth_token'])

I don't know why...

Problems with authentication on Twitter

Hi.
I have an issue related with wrong work with sessions. I'll try to explain
I have done all in FOSTwitterBundle readme instruction.
My config.yml is

services:
    my.twitter.user:
        class: Social\TwitterBundle\Security\User\Provider\TwitterUserProvider
        arguments:
            twitter_oauth: "@fos_twitter.api"
            userManager: "@fos_user.user_manager"
            validator: "@validator"
            session: "@session"
            logger: "@logger"

fos_user:
    db_driver: mongodb
    firewall_name: public
    user_class: Social\TwitterBundle\Document\User

fos_twitter:
    file: %kernel.root_dir%/../vendor/kertz/twitteroauth/twitteroauth/twitteroauth.php
    consumer_key: ___
    consumer_secret: ___
    callback_url: http://symfony.local/app_dev.php/mytest/checkTwitter

have a next security.yml config

providers:
    chainprovider:
        chain:
            providers: [fos_twitter, fos_userbundle]

    fos_twitter:
        id: my.twitter.user

    fos_userbundle:
        id: fos_user.user_manager
firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false

    admin:
        pattern:      /admin(.*)
        context:        user
        form_login:
            provider:       fos_userbundle
            login_path:     /admin/login
            use_forward:    false
            check_path:     /admin/login_check
            failure_path:   null
        logout:
            path:           /admin/logout
        anonymous:    true

    public:
        pattern:  /mytest
        context:  user
        fos_twitter:
            login_path: connect_twitter
            check_path: check_twitter
            default_target_path: mytest
            provider: fos_twitter

        anonymous: ~

So symptoms is next :

When I redirected to connect_twitter route and enter twitter username|pass and return back to main action - i have no token in session. Also i noticed that new session was started (not the same as before authenticate on twitter side).

Another problem is : I did clear all session files on webserver and clear all cookies. And after redirect to twitter side for authentication - i see twitter dialog twice. Looks like one authentication process operate with 2 different sessions.

Can you help me to find the problem, or give a clue in what direction to look for the problem?

Thanks

Symfony 2.1 composer.phar - find kertz/twitteroauth ??

Hey guys,

i have a problem with 'php composer.phar update "kertz/twitteroauth"'.

Problem 1
    - The requested package kertz/twitteroauth could not be found in any version, there may be a typo in the package name.
Problem 2
    - Installation request for friendsofsymfony/twitter-bundle * -> satisfiable by friendsofsymfony/twitter-bundle 1.0.0.
    - friendsofsymfony/twitter-bundle 1.0.0 requires kertz/twitteroauth * -> no matching package found.

What i'm doing wrong?
-> tested git submodules - doesnt work

Error with symfony 2.1

Hi,

I am trying to implement the FOSTwitterBundle and I followed the readme instructions. I'm using the Symfony 2.1 master branch and I get the following error:

User provider "FOS\TwitterBundle\Security\Authentication\Provider\TwitterProvider" must implement "Symfony\Component\Security\Core\User\UserProviderInterface".

I do see the "Uses Symfony\Component\Security\Core\User\UserProviderInterface" line in TwitterProvider.php.
Any idea what could be going wrong?
Thank you.

Non-canonical dependency and SSL verification vulnerability

Reviewing this for a client and noticed these two:

  1. The dependency in composer.json points to kertz/twitteroauth instead of abraham/twitteroauth which is the main branch for twitteroauth. Presumably to have twtteroauth registered on packagist.org and to have better compatibility. This will drift out of date with time.
  2. Both of the twitteroauth libs disable SSL verification by setting CURLOPT_SSL_VERIFYPEER to false for all HTTP requests. The Twitter API is served over HTTPS so this is a security vulnerability (publicly disclosed now for several years: abraham/twitteroauth#52).

The second can be resolved by enabling SSL verification and (since this is a single domain service) distributing the Twitter API certificate to be configured on curl. You'll need to manage the Twitter cert should it ever be replaced (e.g. have a functional test for it in the unit tests) but it may be simpler as a backup to requiring all servers to be properly configured with cert files.

Argument 2 passed error in TwitterProvider

Hi I've been stuck at this for a couple days now. I have this error when i'm trying to load my page. Any suggestions on how to solve this problem or what I can do?

PHP Catchable fatal error: Argument 2 passed to FOS\TwitterBundle\Security\Authentication\Provider\TwitterProvider::__construct() must implement interface Symfony\Component\Security\Core\User\UserProviderInterface, instance of FOS\TwitterBundle\Security\Authentication\Provider\TwitterProvider given, called in /home/gsitu/git/dev-local2/app/cache/dev/appDevDebugProjectContainer.php on line 4731 and defined in /home/gsitu/git/dev-local2/vendor/friendsofsymfony/twitter-bundle/FOS/TwitterBundle/Security/Authentication/Provider/TwitterProvider.php on line 36

Mistake in installation documentation

There is a little mistake in the the install documentation, the path to twitteroauth is wrong :

file: %kernel.root_dir%/../vendor/kertz/twitteroauth/twitteroauth/twitteroauth.php

instead of :

file: %kernel.root_dir%/../vendor/twitteroauth/twitteroauth/twitteroauth.php

Cannot install with composer

Error is:

Updating dependencies
PHP Warning:  assert(): Assertion failed in phar:///home/webdev/sites/composer.phar/src/Composer/DependencyResolver/Solver.php on line 2

Warning: assert(): Assertion failed in phar:///home/webdev/sites/composer.phar/src/Composer/DependencyResolver/Solver.php on line 2
PHP Fatal error:  Call to a member function getId() on a non-object in phar:///home/webdev/sites/composer.phar/src/Composer/DependencyResolver/Rule.php on line 2

Fatal error: Call to a member function getId() on a non-object in phar:///home/webdev/sites/composer.phar/src/Composer/DependencyResolver/Rule.php on line 2

However when I add this to composer.json, everything works

    "repositories":[
        {
            "type":"package",
            "package":{
                "name":"kertz/twitteroauth",
                "version":"dev-master",
                "source":{
                    "url":"git://github.com/kertz/twitteroauth.git",
                    "type":"git",
                    "reference":"origin/master"
                }
            }
        },
        {
            "type":"package",
            "package":{
                "name":"friendsofsymfony/twitter-bundle",
                "version":"dev-master",
                "source":{
                    "url":"git://github.com/FriendsOfSymfony/FOSTwitterBundle.git",
                    "type":"git",
                    "reference":"origin/master"
                },
                "autoload": {
                    "psr-0": { "FOS\\TwitterBundle": "" }
                },
                "target-dir": "FOS/TwitterBundle",
                "require": {
                    "php": ">=5.3.2",
                    "kertz/twitteroauth": "dev-master"
                }
            }
        },

Twitter @Anywhere does not work with provided TwitterProvider / twitteroauth lib

Hello,

As far as I can tell, the Twitter::getAccessToken() method looks for an access token in a request param called 'oauth_token'. Twitter @anywhere does not set this param, rather it sets a cookie, "twitter_anywhere_identity", from which a user id can be extracted.

If this is the case, it is perhaps misleading to provide instructions on implementing @anywhere without noting that @anywhere does not work with the security system.

getAccessToken after login

Hi there,

I'm trying to implement FOSTwitterBundle + Custom UserProvider. Let me try explain my problem.

I'm using login route only and I can get Twitter access token on authentication and create a symfony2 token on session with success.

But in every request after I set session user token, the TwitterProvider try to get AccessToken again.

The problem is in the after login request it dont have oauth_verifier and then a get error here:

    /* Request access tokens from twitter */
    $accessToken = $this->twitter->getAccessToken($request->get('oauth_verifier'));

    /* Save the access tokens. Normally these would be saved in a database for future use. */
    $session->set('access_token', $accessToken['oauth_token']);
    $session->set('access_token_secret', $accessToken['oauth_token_secret']);

on truth, Twitter returns "Invalid / Expired token".

If there is no symfony user session this problem don't happen

Provider "ask" for twitter token every request on user session?

Kind regards!

Something is technically wrong.

I'm getting this error after clicking "Connect" in the twitter popup :

https://oauth.twitter.com/2/authorize?oauth_callback_url=XXXXX&oauth_mode=flow_web_client&oauth_client_identifier=MRAXhACUuskeJs8E8FqJiA&redirect_uri=XXXXXX&response_type=token&_=1320251327784&client_id=MRAXhACUuskeJs8E8FqJiA

From what I've read twitter isn't supporting oAuth 2, so I'm not sure why the bundle is creating this URL.

Am I doing something wrong ? or the bundle is not working ?

Thanks

Adding arguments to setCallbackUrl

Hi, I was working a little with this bundle and I was wonder and it would be good to see arguments that can be passed with the setCallbackUrl so that we I call getCallbackUrl later I can actually make a dynamic url for the callback.

Identity cookie "twitter_anywhere_identity" was not sent.

It seems twitter is not sending the 'twitter_anywhere_identity" cookie anymore. When looking at the response headers of the https://oauth.twitter.com/2/authorize request I only get the _twitter_sess cookie back.

Response headers:

Cache-Control:no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:268
Content-Type:text/html; charset=utf-8
Date:Tue, 30 Aug 2011 08:22:51 GMT
Expires:Tue, 31 Mar 1981 05:00:00 GMT
Keep-Alive:timeout=15, max=99
Last-Modified:Tue, 30 Aug 2011 08:22:51 GMT
Location: CALLBACKURL#oauth_access_token=cjwGAQAAAADbnVxOAAAAAAxoEgAAAAAAeUcHBPSKJqOry9iBnlpDnyJF1T0=kbMnz9NbcgZ6kAaRjHfRZQmCYfsXLyBJJS06JNZI2&oauth_bridge_code=UoO8wJj6d28TtPtweENVWCiJssmwbewDnrTUD2Sic
Pragma:no-cache
Server:hi
Set-Cookie:lang=en; path=/, lang=en; path=/, _twitter_sess=BAh7DToOcmV0dXJuX3RvIgJQAWh0dHBzOi8vb2F1dGgudHdpdHRlci5jb20v%250AMi9hdXRob3JpemU%252Fb2F1dGhfY2FsbGJhY2tfdXJsPWh0dHAlM0ElMkYlMkZy%250Ab2NrZXRsYWIubG8lMkZyb2NrZXRsYWJfZGV2LnBocCUyRnR3aXR0ZXJfY2hl%250AY2smb2F1dGhfbW9kZT1mbG93X3dlYl9jbGllbnQmb2F1dGhfY2xpZW50X2lk%250AZW50aWZpZXI9eG9OdmhqdjdiT1IwTFZEUHNVY3BxUSZyZWRpcmVjdF91cmk9%250AaHR0cCUzQSUyRiUyRnJvY2tldGxhYi5sbyUyRnJvY2tldGxhYl9kZXYucGhw%250AJTJGdHdpdHRlcl9jaGVjayZyZXNwb25zZV90eXBlPXRva2VuJl89MTMxNDY5%250AMjU2NTY3NiZjbGllbnRfaWQ9eG9OdmhqdjdiT1IwTFZEUHNVY3BxUToPY3Jl%250AYXRlZF9hdGwrCFYkixkyAToMY3NyZl9pZCIlNWVhZGFkMmIzMTdkOTg0ZWQz%250ANTU2ZDE4YWQyYTU0MjI6CXVzZXJpBHI8BgE6B3VhInhNb3ppbGxhLzUuMCAo%250ATWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF83XzEpIEFwcGxlV2ViS2l0%250ALzUzNC40OC4zIChLSFRNTCwgbGlrZSBHZWNrbykgVmVyc2lvbi81LjEgU2Fm%250AYXJpLzUzNC40OC4zOhNwYXNzd29yZF90b2tlbiItYjAxZjhhZDE2YWZmZjli%250ANzNkYzNmZWE5NWM5YTRlMmZkOTIzN2I2NiIKZmxhc2hJQzonQWN0aW9uQ29u%250AdHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoHaWQiJTI5%250AYzM4ZGI4ODBiMDE1ZjFkNGY3Njg0ZWNiMGU4ZTJi--e662c4949403c38e971dad104e2947d45060ef9c; domain=.twitter.com; path=/; HttpOnly
Status:302 Found
Vary:Accept-Encoding
X-Content-Type-Options:nosniff
X-Frame-Options:DENY
X-MID:f6747a2d81060ac13a7e523fe9e67cae64536a49
X-Revision:DEV
X-Runtime:0.07750
X-Transaction:1314692571-17681-58681
X-XSS-Protection:1; mode=block

Did the twitter api change or did I do something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.