I am looking for a way to "preload" select Twitter users/accounts by setting up their users in Drupal before their first login using their Twitter user name as their user name, the Twitter module and OAuth. New users can log in just fine with OAuth but when I add a user through Drupal first then the user attempts an OAuth/Login with Twitter login Drupal denies the attempt with a duplicate user name error message.

I appreciate any insight on this. Thanks!

Comments

InTheLyonsDen’s picture

UPDATE: I was able to tie together a preloaded Drupal user account with a user's OAuth login upon login without the user having to go through the registration process.

1. Add the user as a Drupal user including profile details like website URL, bio, etc., OG settings, user role, etc.
2. Manually insert the users Drupal User ID [uid], Twitter Screen name [screen_name], and Twitter User ID [twitter_uid] into the 'twitter_account' table in MySQL.
3. The user logs in to the website using OAuth and all of their profile and security information is in tact.

The issues with this are:

1. It's manual. I don't have to do it often so it works but still manual.
2. I had to user a Twitter API call to obtain the users [twitter_uid] based on their Twitter screen name. This is messy as again it was manual.
3. Did I mention it was manual?

So, does anyone have any ideas how to make it not so manual? Maybe a form to dump the Twitter screen names in and an easy button at the bottom?

Thanks!
Kevin

mrf’s picture

Component: Code » Documentation
Category: support » task

Would be great to get this turned into a Docs page, even if you still have to do this manually I'm sure someone might be helped out by this.

dddave’s picture

Version: 6.x-3.0-beta2 » 6.x-5.x-dev
damienmckenna’s picture

Title: Preload Twitter User Accounts When Using OAuth » Preload Twitter user accounts using OAuth via matched usernames
Version: 6.x-5.x-dev » 7.x-6.x-dev
Issue summary: View changes

Am also wondering how that would be done..