asp.netazureidentityreset-passwordmachinekey

How to share the same machinekey for webAPI and MVC website in Azure


We have got a ASP.Net 4.7 MVC project in Azure which handles the user reset password with Identity. The user click on Forgot Password and they get an email with link to the website with a token. This works on MVC, but not on the API. The code that generates the token is shared on both application, so we think it is probably down to have a different machine key.

The code for resetting the password is this which I think it is ok:

var userManager = Users.User.GetApplicationUserManager();
var result = userManager.ResetPassword(userId, token, password);
return result.Succeeded;

I had a look at the rootweb.config for the MVC and the API and they have different machine keys provided by Azure. This may be the problem. Is there a way to share the same machine key in Azure so reset password works?

Thanks


Solution

  • I added the machine key in the web.config files for both applications to have the same.