0

I am using wordpress but I need to put a twitter @anywhere / login connect button.

What my issue is, how in the world would I know what their password is?

it's all fine getting the username etc... but how would I trigger my wordpress to login the user without knowin his/her password, all I can do right now is know that they are loggedin on twitter thats about it, but obviously twitter wont give his/her password away!

any suggestions?

UPDATED

This is the process so far...

  • Display twitter connect button
  • User the on comeplete listener to capture users "screen_name"
  • ??? Now I need to assign a password to the form to log this user in...???

That is where I am stack.

Val
  • 17,336
  • 23
  • 95
  • 144

1 Answers1

0

If you're using Twitter's OAuth to authenticate users, you don't need their password. If you can get a user info (name, email, etc), then the user is authenticated in Twitter and has authorized your app to access his data. Take the data and do your job (create your local user account and log him in programmatically).

Here's a plugin that might help you: http://wordpress.org/extend/plugins/simple-twitter-connect/

Also here's a Wordpress API call that lets you log user in: http://codex.wordpress.org/Function_Reference/wp_signon

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
  • thats what I have done, I can't seem to figure out how can I log the user in on my website, ??? – Val Apr 20 '12 at 13:19
  • yes, but how would I know what the `$creds['user_password'] = 'plaintextpw';` would be, coz If I used twitter to connect I would have to generate the password myself right? like a random one, suppose I do that, then I am not saving a plain password on the db is not cool, – Val Apr 20 '12 at 13:37
  • in this case also set a flag for twitter users that'll prevent them from logging in normally. So, even if someone steals your db, they won't be able to login. – Sergio Tulentsev Apr 20 '12 at 13:41