Why are we are getting the following error when trying to login to the Artifactory: ‘HTTP Status 500 – Bad credentials’

When you see the following error when attempting to log in:

 

HTTP Status 500 - Bad credentials

 

type Exception report

message Bad credentials

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.security.authentication.BadCredentialsException: Bad credentials

        org.springframework.security.authentication.dao.DaoAuthenticationProvider.additionalAuthenticationChecks(DaoAuthenticationProvider.java:87)

        org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:149)

        org.artifactory.security.db.DbAuthenticationProvider.authenticate(DbAuthenticationProvider.java:47)

        org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)

 

 

        org.artifactory.security.RealmAwareAuthenticationManager.authenticate(RealmAwareAuthenticationManager.java:72)

 

This is probably caused by corruption of the anonymous user in the database.  It is used during login and if it has been touched you'll receive a failure like the one above.

 

The easiest way to fix the problem is to go into the database, delete the anonymous user, and then restart artifactory.  That will force artifactory to recreate the user and allow you to log in.  

 

If this doesn't fix the problem make sure that the database password credentials stored in etc/storage.properties can be used to log into the database you're using.