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.