Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception 'Bad credentials' #1619

Closed
kvidzibo opened this issue Sep 28, 2014 · 7 comments
Closed

exception 'Bad credentials' #1619

kvidzibo opened this issue Sep 28, 2014 · 7 comments

Comments

@kvidzibo
Copy link

Hi,
after updating my vendors my users started complaining about one issue.. it took time for me to find it but here it is:
if i enter bad user name or bad password instead of writing friendly user message it writes:

exception 'Symfony\Component\Security\Core\Exception\BadCredentialsException' with message 'Bad credentials' in /var/www/html/art/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php:90
Stack trace:
#0 /var/www/html/art/app/cache/dev/classes.php(120): session_start()
#1 /var/www/html/art/app/cache/dev/classes.php(198): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#2 /var/www/html/art/app/cache/dev/classes.php(498): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('attributes')
#3 /var/www/html/art/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ContextListener.php(76): Symfony\Component\HttpFoundation\Session\Session->get('_security_main')
#4 /var/www/html/art/app/cache/dev/classes.php(2463): Symfony\Component\Security\Http\Firewall\ContextListener->handle(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent))
#5 [internal function]: Symfony\Component\Security\Http\Firewall->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
#6 /var/www/html/art/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php(59): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
#7 [internal function]: Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
#8 /var/www/html/art/app/cache/dev/classes.php(1750): call_user_func(Object(Symfony\Component\EventDispatcher\Debug\WrappedListener), Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))
#9 /var/www/html/art/app/cache/dev/classes.php(1683): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.request', Object(Symfony\Component\HttpKernel\Event\GetResponseEvent))
#10 /var/www/html/art/app/cache/dev/classes.php(1847): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.request', Object(Symfony\Component\HttpKernel\Event\GetResponseEvent))
#11 /var/www/html/art/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php(112): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object(Symfony\Component\HttpKernel\Event\GetResponseEvent))
#12 /var/www/html/art/app/bootstrap.php.cache(2965): Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.request', Object(Symfony\Component\HttpKernel\Event\GetResponseEvent))
#13 /var/www/html/art/app/bootstrap.php.cache(2938): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#14 /var/www/html/art/app/bootstrap.php.cache(3087): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /var/www/html/art/app/bootstrap.php.cache(2337): Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/html/art/web/app_dev.php(28): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#17 {main} 
@sstok
Copy link

sstok commented Sep 29, 2014

Please place the exception between markdown code blocks for better readability.
https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks

Are you using a custom template, have you cleared the cache, make sure the bootstrap.php.cache was updated. And cleared all old sessions.

@stof
Copy link
Member

stof commented Sep 29, 2014

I'm quite sure you have a custom template, and you need to update it for changes done in 8488843.

You need to either lock your dependencies on 2.0-alpha1 or read the upgrade instructions when upgrading the bundle

@stof stof closed this as completed Sep 29, 2014
@jaznow
Copy link

jaznow commented Oct 6, 2014

I had the same problem after updating the bundle, you just need to modify your template to only show the message, instead of the full exception like this:
Replace this:

{{ error|trans }}

For this:

{{ error.messageKey|trans(error.messageData, 'security') }}

@kvidzibo
Copy link
Author

kvidzibo commented Oct 6, 2014

i solved it thanks, i totally forget that i was using custom template :)

On Mon, Oct 6, 2014 at 1:10 PM, Benjamin [email protected] wrote:

I had the same proble, you just need to modify your template to only show
the message, instead of the full exception like this:
Replace this:
{{ error|trans }}

For this:
{{ error.messageKey|trans(error.messageData, 'security') }}


Reply to this email directly or view it on GitHub
#1619 (comment)
.

@duccoder
Copy link

duccoder commented Oct 9, 2014

@benjamitauler I had same problem. Thank you

@stof
Copy link
Member

stof commented Oct 9, 2014

@fabienzet the solution is the same: either update your custom template to match the changes done in the bundle, or lock your dependency to the alpha1 release before the change

@duccoder
Copy link

duccoder commented Oct 9, 2014

@stof yes, I lock dependency to stable version. Of habit, I usually let it be "dev-master", quite dangerous

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

No branches or pull requests

5 participants