fixes on CustomAuthenticationProvider