piwik-dotnet-api icon indicating copy to clipboard operation
piwik-dotnet-api copied to clipboard

passwordConfirmation for UsersManager.updateUser

Open grzech1983 opened this issue 5 years ago • 1 comments

Hello,

I'm just notifying that from version 3.8.0 of Matomo updating user is not working anymore because of:

https://developer.matomo.org/changelog

Breaking Changes When changing the email address or the password through the UsersManager.updateUser API, a new parameter passwordConfirmation needs to be sent along with the request containing the current password of the user issuing the API request.

and since API is not using any credentials at all only token then IMHO is not usable in current state.

Adding new user using addUser is also needing new param: initialIdSite

- UsersManager.addUser (userLogin, password, email, alias = '', initialIdSite = '') [ No example available ]

Thanks

grzech1983 avatar Mar 13 '19 11:03 grzech1983

@grzech1983 What do you mean it is not usable? The library method or the API method itself? The library could be easily updated.

Concerning your second point, did you saw any issues when initialIdSite is not passed? And do you have any idea, what it is doing? There is no documentation. :(

This is how our code is implemented.

int[] idSites = { piwikSiteId };
var password = Membership.GeneratePassword(16, 3);
response = usersManager.addUser(piwikUserName, password, piwikUserEmail);
if (!response["result"].Equals("success"))
{
  throw new OperationCanceledException($"Unable to create piwik user. Received status: {response["result"]}");
}

response = usersManager.setUserAccess(piwikUserName, UsersManager.UserAccess.view, idSites);

We did not saw any issues, but I confirm it makes sense to update the library.

Fensterbank avatar Apr 24 '19 15:04 Fensterbank