Tuesday, April 30, 2013

Re: Help with Cake Auth - Manual Login

What values are you passing inside of the $user array. I assume just a username and what else?

On Tuesday, April 30, 2013 9:01:45 PM UTC-6, Shahruk Khan wrote:
This is the working code I have:

if($this->Auth->login($user['User']))

Using this, I was able to force log my users in via Facebook. Do a find for the user and pass the User array.

On Tuesday, April 30, 2013 5:22:18 PM UTC-4, James Lukensow wrote:
I'm running into a issue here, trying to get Cake to manually log a user in. Here is what I am trying to accomplish.

I'm using a XML-RPC to log the user in to Vbulletin from Cakephp, what I get back are some cookies, and user info. On the CakePhp Side of things, I have a Users table, which contains:

1. id
2. vbulletinid
3. username
4. avatar
5. created
6. modified

Now, when you're on the Cake side of things, and you log in, within my login() method, I grab the following, for the xml-rpc call:

$username = $this->request->data['User']['username'];
$password = $this->request->data['User']['password'];

If the response is valid, and the user is logged in remotely to vbulletin, I then insert the user into the Users table. If they're already in there, I just update the username and avatar, etc.

So, I was trying to do the following, to force the login:

$this->Auth->login($user)

Where $user contained:

Array
(
    [User] => Array
        (
            [id] => 13
            [username] => testuser
        )

)

I thought everything was working, until I turned off the Debugkit plugin. Then, it seems like my login is not working actually. With it turned off, I can't force Cake to log my current user in.

Anyone have any ideas on how to force a login?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: