Changeset 7016eb4cb4364248b02c2b3336aff5da9a22e032
- Timestamp:
- 02/04/12 10:56:10 (4 months ago)
- Author:
- Xemle <xemle@phtagr.org>
- Children:
- 33295e2f6bf20f39b0391fe58f4b96f0d18e8667
- Parents:
- 863220d612ed27e28b1e8e1f6e4c3d95efb8d35f
- git-committer:
- Xemle <xemle@phtagr.org> / 2012-02-04T10:56:10Z+0100
- Message:
-
Fix digest authentication for CakePHP 2.0
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rbfbeeb6
|
r7016eb4
|
|
| 88 | 88 | |
| 89 | 89 | Logger::trace("Add authentications header"); |
| 90 | | header('WWW-Authenticate: Digest realm="'.$this->realm.'",qop="auth",nonce="'.uniqid().'",opaque="'.$opaque.'",algorithm="MD5"'); |
| | 90 | $this->controller->response->header('WWW-Authenticate', 'Digest realm="'.$this->realm.'",qop="auth",nonce="'.uniqid().'",opaque="'.$opaque.'",algorithm="MD5"'); |
| 91 | 91 | } |
| 92 | 92 | |
| … |
… |
|
| 99 | 99 | $this->__addDigestRequestHeader(); |
| 100 | 100 | } |
| | 101 | $this->controller->response->statusCode(401); |
| 101 | 102 | $this->controller->redirect(null, 401, true); |
| 102 | 103 | } |
| … |
… |
|
| 258 | 259 | } |
| 259 | 260 | $this->Session->id($sid); |
| 260 | | $this->Session->start(); |
| 261 | 261 | |
| 262 | 262 | if (!$this->Session->check('auth.nc')) { |
| … |
… |
|
| 271 | 271 | $snc=$this->Session->read('auth.nc'); |
| 272 | 272 | $nc=hexdec($this->_authData['nc']); |
| 273 | | if ($snc==$nc) |
| | 273 | if ($snc==$nc) { |
| 274 | 274 | Logger::warn("Same request counter $snc is used!"); |
| | 275 | } |
| 275 | 276 | |
| 276 | 277 | // Check request counter |