Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

screen name instead of user id #34

Open
glanchow opened this issue Jun 30, 2012 · 2 comments
Open

screen name instead of user id #34

glanchow opened this issue Jun 30, 2012 · 2 comments

Comments

@glanchow
Copy link

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.

@net02
Copy link

net02 commented Nov 29, 2012

yup, i was following the docs to integrate it with FOSUserBundle, and in the suggested security provider it uses twitterID, yet the value passed is the screen_name. And as you said, it's not reliable.

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

will fix it.
I'll attach a pull request asap ;)

@glanchow
Copy link
Author

thank you net02 but there was a pullrequest on that duplicate thread.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants