Identity Server 3 error : User is not active. Redirecting to login

Viewed 1185

I am stuck with this problem:

I am using Identity Server 3 with ASP.Net Identity. When I reset my password the first time everything works fine and I am able to log in with my new password.

Now when I try the forgot password feature a second time, Identity Server does not recognize the new password and throws me an invalid username password error.

After some digging and debugging I found out that IdSrv does not have a fresh DB context and that's why it does not find the new password.

I tried overriding UserServiceAuthenticateLocalAsync and I forced the authentication to succeed like this :

 context.AuthenticateResult = new AuthenticateResult(user.UserName, user.UserName);

Now I am getting these logs:

IdentityServer3.Core.Endpoints.AuthenticationController|Login credentials successfully validated by user service
IdentityServer3.Core.Endpoints.AuthenticationController|Calling PostAuthenticateAsync on the user service
// Some more logs...
IdentityServer3.Core.ResponseHandling.AuthorizeInteractionResponseGenerator|User is not active. Redirecting to login.

I don't know why IdSrv is saying that my user is not valid.

Any ideas ?

0 Answers
Related