Fixes in AuthenticationProvider. Fixing testsuite