Some Matomo (Piwik) users automatically provide their CMS customers with Matomo statistics. If you want to provide a one-click automatic login to Matomo for your users, you can use the ‘logme’ mechanism, and pass their login & the md5 string of their password in the URL parameters:

https://stats.example.org/index.php?module=Login&action=logme&login=your_login&password=your_MD5_password

This will securely login the user (create a cookie in their browser) and redirect to the index.php on successful login. Note that this authentication method doesn’t work for a user with Super User access.
You can also specify the URL to redirect after a successful login, if different from the default Matomo dashboard page:

https://stats.example.org/index.php?module=Login&action=logme&login=your_login&password=your_MD5_pwd&url=http://piwik.mycompany.com/subpath/

You can also specify a website ID (idSite) that will be loaded by default after the redirect:

https://stats.example.org/index.php?module=Login&action=logme&login=your_login&password=your_MD5_pwd&idSite=145

Important: we recommend to make this request over https (SSL) in order to keep the password hash secure, and we also recommend to POST the password and login URL parameters (instead of sending it as GET parameters, which may be visible in browser history and web server access logs).

Since version 3.0 Matomo does not store the password as md5 any longer. As a result there is no way to access the md5 hashed password using the API. To generate the md5 password, you need the user’s raw password and then call the md5() hash function on this raw password using your favorite programming language.

As of Matomo 4.4.0 this feature is disabled by default for security reasons. You can enable it by setting this in your config.ini.php:

[General]
login_allow_logme = 1
Previous FAQ: How do I enable users to login into Matomo inside an iframe?