Change Password Functionality returns Invalid Token

Vote:
 

Hi All

I'm trying to implement a Change Password Page, although upon executing userManager.ChangePassword, I am presented with the error Invalid Token. 

Any assistance would be much appreciated 

                var userManager = ServiceLocator.Current.GetInstance();
                var userProvider = ServiceLocator.Current.GetInstance();

                var user = userProvider.GetUser(changePasswordPostbackData.Username); 

               
                var isValid = userManager.ChangePassword(user, changePasswordPostbackData.OldPassword, changePasswordPostbackData.NewPassword);
2017-11-07 17:45:39,194 [37] ERROR EPiServer.Global: 1.2.5 Unhandled exception in ASP.NET
System.ArgumentException: Invalid token.
   at EPiServer.Cms.UI.AspNetIdentity.ApplicationUIUserManager`1.ChangePassword(IUIUser user, String oldPassword, String newPassword)

Regards

Minesh

#184979
Nov 07, 2017 18:56