Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

providing invalid credentials ends in an infinite loop #30

Open
janpieper opened this issue Nov 4, 2011 · 1 comment
Open

providing invalid credentials ends in an infinite loop #30

janpieper opened this issue Nov 4, 2011 · 1 comment

Comments

@janpieper
Copy link
Contributor

There is no handling for invalid credentials in Doctrine\CouchDB\HTTP\SocketClient.php so it ends in an infinite loop.

  #    Time      Memory      Function                                                      Location
-----------------------------------------------------------------------------------------------------------------------
  1    0.0007      650752    {main}( )                                                     ../app_dev.php:0
  2    0.0259     5910352    Symfony\Component\HttpKernel\Kernel->handle( )                ../app_dev.php:24
  3    0.0450     8872896    Symfony\Bundle\FrameworkBundle\HttpKernel->handle( )          ../bootstrap.php.cache:547
  4    0.0451     8873904    Symfony\Component\HttpKernel\HttpKernel->handle( )            ../classes.php:5013
  5    0.0451     8873904    Symfony\Component\HttpKernel\HttpKernel->handleRaw( )         ../classes.php:4040
  6    0.0698    12040336    call_user_func_array ( )                                      ../classes.php:4070
  7    0.0698    12040704    My\DummyBundle\Controller\IndexController->indexAction( )     ../classes.php:4070
  8    0.0757    13437232    Doctrine\ODM\CouchDB\DocumentManager->persist( )              ../IndexController.php:87
  9    0.0757    13437232    Doctrine\ODM\CouchDB\UnitOfWork->scheduleInsert( )            ../DocumentManager.php:257
 10    0.0757    13437544    Doctrine\ODM\CouchDB\UnitOfWork->doScheduleInsert( )          ../UnitOfWork.php:301
 11    0.0823    13901792    Doctrine\ODM\CouchDB\UnitOfWork->persistNew( )                ../UnitOfWork.php:317
 12    0.0825    13928200    Doctrine\ODM\CouchDB\Id\CouchUUIDGenerator->generate( )       ../UnitOfWork.php:965
 13    0.0825    13928200    Doctrine\CouchDB\CouchDBClient->getUuids( )                   ../CouchUUIDGenerator.php:41
 14    0.0825    13928568    Doctrine\CouchDB\HTTP\LoggingClient->request( )               ../CouchDBClient.php:129
 15    0.0826    13928808    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../LoggingClient.php:65
 16    0.0858    13942904    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
 17    0.0883    13948056    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
 18    0.0916    13953208    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
 19    0.0963    13958384    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
 20    0.1003    13963536    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
...
295    0.9438    16428080    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
296    0.9458    16433232    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
297    0.9477    16438384    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
298    0.9497    16443536    Doctrine\CouchDB\HTTP\SocketClient->request( )                ../SocketClient.php:249
299    0.9497    16443536    Doctrine\CouchDB\HTTP\SocketClient->buildRequest( )           ../SocketClient.php:133

The $body variable contains the following JSON:

{"error":"unauthorized","reason":"Name or password is incorrect."}
@janpieper
Copy link
Contributor Author

You can uncomment WWW-Authenticate in your /etc/couchdb/local.ini to receive 401 Unauthorized instead of 302 Found but the client should not end in an infinite loop if WWW-Authenticate is commented out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant