Re: Issues with digest authentication - need some help

2012-11-05 Thread Nir Regev
This does not seem to help :(

I've added a log to watch when / which user arrives at isAuthorized and 
found out that when using BASIC authentication, I can see the user without 
a problem but when using DIGEST the isAuthorized function does not run at 
all.

Another thing about all this : when allowing DIGEST only, using a browser I 
can login without a problem, the issue seems to appear only when using CURL 
(--digest of course)

Using curl in verbose mode I can see that it gets a 302 response without 
any expected DIGEST data (such as realm etc.)

Any further suggestions ?

10x.

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Issues with digest authentication - need some help

2012-11-03 Thread Ivan Rimac
in app controller

public function isAuthorized() {
  return $this->Auth->user('id');
}

this should solve your problems.



On Fri, Nov 2, 2012 at 5:16 PM, Nir Regev  wrote:

> Hi all !
>
> I'm rather mew to cake and trying to create a set of REST services with
> the need for DIGEST auth.
>
> configuration :
> - I'm using cake 2.2.3
> - in AppController I've got this setup :
>
> public $components = array(
> 'RequestHandler',
> 'Session',
> 'Auth' => array(
> 'authenticate' => array(
> 'Digest' => array(
> 'userModel' => 'User',
> 'realm' => 'somerealm',
> 'fields' => array ('password' => 'digest_hash')
> )
> ),
> 'authorize' => array('Controller')
> )
>
> beforeFilter functions are not defined in Users/App controller
>
> in UsersController I'v added a 'whoami' function to show currently logged
> on user name
>
> Using curl --digest --user  "user:pass" "
> http://127.0.0.1/cake/Users/whoami";
>
> problem is : I can never get the user to login !
> hashes and all are fine, same user can login user forms auth. if I allow
> it.
>
> curl gets 302 redirect to /Users/login
>
> The only time I can get 'whoami' to work is if I Auth->allow it in
> beforeFilter but then I naturally don't have the user logged in.
>
> Any suggestions ?
>
> Thanks, Nir.
>
>
>
>  --
> 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 post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
*Ivan Rimac***
mail: ivn...@gmail.com
*tel: +385 95 555 99 66*
*http://ivanrimac.com*

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Issues with digest authentication - need some help

2012-11-02 Thread Nir Regev
Hi all !

I'm rather mew to cake and trying to create a set of REST services with the 
need for DIGEST auth.

configuration :
- I'm using cake 2.2.3 
- in AppController I've got this setup :

public $components = array(
'RequestHandler',
'Session',
'Auth' => array(
'authenticate' => array(
'Digest' => array(
'userModel' => 'User',
'realm' => 'somerealm',
'fields' => array ('password' => 'digest_hash')
)
), 
'authorize' => array('Controller')
)

beforeFilter functions are not defined in Users/App controller

in UsersController I'v added a 'whoami' function to show currently logged 
on user name

Using curl --digest --user  "user:pass" 
"http://127.0.0.1/cake/Users/whoami"; 

problem is : I can never get the user to login ! 
hashes and all are fine, same user can login user forms auth. if I allow it.

curl gets 302 redirect to /Users/login

The only time I can get 'whoami' to work is if I Auth->allow it in 
beforeFilter but then I naturally don't have the user logged in.

Any suggestions ?

Thanks, Nir.



-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.