@hamzahamidi opened this Issue on April 24th 2018

I'm trying to sign via command line to the token_auth but can't seem to work. I always get the piwik.token_auth = "anonymous";
This is my script:

printf "%bGet form_nonce...%b\n" "${YELLOW}" "${STD}"
curl POST "https://piwik.platform/index.php" >nonce.log
NONCE=$(grep -m 1 "form_nonce" nonce.log |sed -e 's/.*value="//'|sed -e 's/"\/>//')
printf "${NONCE}"
curl -v -D headr.log POST "https://piwik.platform/index.php" -d "form_login=login&form_password=password&form_nonce=${NONCE}" >sign-in.log

Any idea on what could be the problem?

@fdellwing commented on April 24th 2018 Contributor

I think you missunderstood how token_auth is working:

curl "https://demo.matomo.org/?module=API&method=UsersManager.getTokenAuth&userLogin=test&md5Password=d8e8fca2dc0f896fd7cb4cb0031ba249&format=original"

Returns an valid token_auth that you can use afterwards.

See https://developer.matomo.org/api-reference/reporting-api#UsersManager for an overview about all methods.

@hamzahamidi commented on April 24th 2018

@fdellwing But isn't it weird that the token changes when you refresh the page?

@sgiehl commented on April 24th 2018 Member

That shouldn't be the case for valid userLogin / md5Password combinations

@hamzahamidi commented on April 24th 2018

@sgiehl @fdellwing Thank you, it worked.

@tsteur commented on April 24th 2018 Member

BTW: For general questions please ask in the Platform forum as we usually don't answer questions here: https://forum.matomo.org/c/plugins-platform

This Issue was closed on April 24th 2018
Powered by GitHub Issue Mirror