Security token username and password cannot be validated

we are having trouble in generating security token for anonymous login. We have two kinds of login:

  1. Usual username and password (Registered)
  2. Using the 2 user’s info(Unregistered/Anonymous)

We are using Claims Based Authentication, Sharepoint 2010.

Anonymous login was working perfectly around 2 weeks before, but now it does not.

User is redirected to login page instead of the destined page.

Web configs for STS, Services, Virtual Directories are the same. ULS logs:

  • w3wp.exe (0x4200) 0x09F0 SharePoint Foundation Claims Authentication Critical An exception occurred when trying to issue
    security token: The security token username and password could not be validated..
  • w3wp.exe (0x4200) 0x09F0 SharePoint Foundation Claims Authentication Could not rebuild forms user token.
  • w3wp.exe (0x5450) 0x09E0 SharePoint Foundation Claims Authentication User ‘{0}’ not found.
  • w3wp.exe (0x5450) 0x09E0 SharePoint Foundation Claims Authentication Failed validation on user ”.
  • w3wp.exe (0x5450) 0x09E0 SharePoint Foundation Claims Authentication SPSecurityTokenService.Issue() failed:
    System.ServiceModel.FaultException`1[Microsoft.IdentityModel.Tokens.FailedAuthenticationException]: The security token username and password could not be validated.
    (Fault Detail is equal to
    Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The
    security token username and password could not be validated.).

  • w3wp.exe (0x4200) 0x1E44 SharePoint Foundation Claims Authentication Request for security token failed with exception:
    System.ServiceModel.FaultException: The security token username and
    password could not be validated. at
    Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response) at
    Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) at
    Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst) at
    Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri
    context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo)

  • w3wp.exe (0x4200) 0x1E44 SharePoint Foundation Claims Authentication An exception occurred when trying to issue security
    token: The security token username and password could not be
    validated..

What else could be cause of the issue?

Update

Custom login, which the anonymous or unregistered user uses, uses SPClaimsUtility.AuthenticateFormUser(uri, username, password).