Page 1 of 1

How to pass password info for auto login

PostPosted: April 25th, 2011, 9:48 pm
by afurlan11
Hi-
I'm wondering if this is possible at all and if so how to do it:

I have my site, which registers a user. That registration information needs to be passed to a second site to register the user with the same information on that site. The login information needs to be the same on both sites so that a user can log in to my site and not even know they had to log into the second site.

I need to know how to pass the password upon registration (to create the second identical account) and then whenever that user logs into my site (to auto login to the second site).

Any help would be greatly appreciated!

Thanks!!

Re: How to pass password info for auto login

PostPosted: April 26th, 2011, 12:09 am
by Cristián Lávaque
You may find info on that here http://www.google.com/search?q=wordpress+share+users

I hope that helps. :)

Re: How to pass password info for auto login

PostPosted: April 26th, 2011, 8:11 am
by afurlan11
Thanks for the quick reply, but my issue is not between 2 wordpress blogs. It's between my wordpress site and a site being hosted completely separately from anything I'm doing.

Is that possible at all?

Re: How to pass password info for auto login

PostPosted: April 26th, 2011, 10:58 am
by Cristián Lávaque
Not normally. You need access to the database/scripts of both sites to do such an integration.

That said, if you use a login service like OpenID and such others, then you'd be sharing login info between several sites you don't have access to, but not just that other one specificially.

Sorry, I'm not sure how to help you here.

Re: How to pass password info for auto login

PostPosted: April 28th, 2011, 10:53 am
by afurlan11
I had a thought. If I can set a session variable of the user entered password before it is encrypted for compare against what is in the DB I think that will work. Where should I look to find where a user is authenticated upon login and also when a user registers (before encryption)?

Re: How to pass password info for auto login

PostPosted: April 28th, 2011, 12:50 pm
by Cristián Lávaque
I don't know if it can be done, passwords are quite protected in well written applications such as WordPress.

That said, I suggest you try Google and WordPress.org to find the way to de that, if possible.

I'm sorry I couldn't help you much with this. :|

Re: How to pass password info for auto login

PostPosted: May 4th, 2011, 8:32 am
by afurlan11
In case anyone else is looking for this answer, I figured it out. First you must make sure your php.ini has the setting register_globals set to off otherwise the session variables are erased on every page. Then in pluggable.php, you can grab the plain-text passwords, usernames, etc and set them as you would any php session variable. Then you can use your session variables in a url to pass, to display, etc.