You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/5.x/authentication-in-depth.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ There are different ways a user can authenticate in Matomo:
9
9
* Using username / password and the regular login form.
10
10
* The [logme](https://matomo.org/faq/how-to/faq_30/) feature can be used to log someone in using username and password in the URL.
11
11
* Using a `token_auth` URL parameter for our HTTP API's and widgets.
12
-
* Using OAuth2 bearer tokens for external applications when the OAuth2 plugin is installed.
12
+
* Using OAuth 2.0 bearer tokens for external applications when the OAuth 2.0 plugin is installed.
13
13
14
14
## Username and password login
15
15
@@ -65,13 +65,13 @@ When there is a request and we can use a session, then Matomo [checks first if t
65
65
* When a `token_auth` parameter is set by us, then we usually POST the token_auth. This is for security reasons so the token_auth won't appear in server logs. Otherwise a sysadmin could see the token in the logs and do all sort of actions on behalf of another user.
66
66
* Remember that users should not share the token_auth as it is the same as them sharing their username/password.
67
67
68
-
## OAuth2
68
+
## OAuth 2.0
69
69
70
-
If the [OAuth2](/guides/oauth2) plugin is installed, external applications can authenticate against Matomo using OAuth2 access tokens.
70
+
If the [OAuth 2.0](/guides/oauth2) plugin is installed, external applications can authenticate against Matomo using OAuth 2.0 access tokens.
71
71
72
-
This is mainly useful when integrating third-party or custom applications that should not receive a long-lived `token_auth`. In that case the application first obtains an access token through the plugin's OAuth2 endpoints and then sends that token as a bearer token when calling supported Matomo APIs.
72
+
This is mainly useful when integrating third-party or custom applications that should not receive a long-lived `token_auth`. In that case the application first obtains an access token through the plugin's OAuth 2.0 endpoints and then sends that token as a bearer token when calling supported Matomo APIs.
73
73
74
-
Depending on the application type, you would typically use either the Authorization Code flow with PKCE or the Client Credentials flow. For the integration flow and request examples, see the [OAuth2 guides](/guides/oauth2).
74
+
Depending on the application type, you would typically use either the Authorization Code flow with PKCE or the Client Credentials flow. For the integration flow and request examples, see the [OAuth 2.0 guides](/guides/oauth2).
Copy file name to clipboardExpand all lines: docs/5.x/oauth2.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,14 @@ subGuides:
7
7
- oauth2/api-usage
8
8
- oauth2/faq
9
9
---
10
-
# OAuth2
10
+
# OAuth 2.0
11
11
12
-
This section contains guides that will help you authenticate external applications against Matomo using OAuth2.
12
+
This section contains guides that will help you authenticate external applications against Matomo using OAuth 2.0.
13
13
14
-
**OAuth2**is a plugin for Matomo that adds a first-party OAuth2 Authorization Server. It allows external applications to access Matomo APIs using OAuth2 access tokens instead of sending a `token_auth`.
14
+
The **OAuth 2.0** plugin adds a first-party OAuth 2.0 Authorization Server to Matomo. It allows external applications to access Matomo APIs using OAuth 2.0 access tokens instead of sending a `token_auth`.
15
15
16
-
The plugin supports the **Authorization Code** flow with **PKCE**, **Client Credentials**, and **Refresh Token** support. OAuth clients can be managed in Matomo under **Administration => Platform => OAuth2**. In Matomo Cloud, this screen is available under **Administration => Export => OAuth2**.
16
+
The plugin supports the **Authorization Code** flow with **PKCE**, **Client Credentials**, and **Refresh Token** support. Applications authenticate with bearer tokens and can be limited to the scopes granted to each OAuth client.
17
+
18
+
OAuth 2.0 clients can be managed in Matomo under **Administration => Platform => OAuth 2.0**. In Matomo Cloud, this screen is available under **Administration => Export => OAuth 2.0**. From there you can create, edit, pause, resume, or delete clients, and rotate secrets for confidential clients.
17
19
18
20
If you are looking for general API authentication details, also see [Authentication In Depth](/guides/authentication-in-depth) and [Querying the Reporting API](/guides/querying-the-reporting-api).
By default, many Matomo API guides use `token_auth` examples because `token_auth` is available in every Matomo installation.
29
29
30
-
When the OAuth2 plugin is installed, external applications can use OAuth2 bearer tokens instead. This avoids sharing a long-lived auth token with the external application and lets you choose a grant type that matches the integration.
30
+
When the OAuth 2.0 plugin is installed, external applications can use OAuth 2.0 bearer tokens instead. This avoids sharing a long-lived auth token with the external application, lets you choose a grant type that matches the integration, and makes it easier to limit and revoke access without affecting other applications.
31
31
32
32
If you are integrating a backend service with no user interaction, the Client Credentials flow is usually the best fit. If your application acts on behalf of a user, use the Authorization Code flow.
33
33
34
34
## Notes
35
35
36
36
* Use HTTPS whenever you send access tokens.
37
37
* The plugin currently allows only one scope per request.
38
-
* Keep using the standard `token_auth` flow in integrations where the OAuth2 plugin is not installed.
38
+
* Keep using the standard `token_auth` flow in integrations where the OAuth 2.0 plugin is not installed.
Copy file name to clipboardExpand all lines: docs/5.x/oauth2/faq.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
category: Integrate
3
-
title: OAuth2 Developer FAQ
3
+
title: OAuth 2.0 Developer FAQ
4
4
---
5
-
# OAuth2 Developer FAQ
5
+
# OAuth 2.0 Developer FAQ
6
6
7
7
## Which grant types are supported?
8
8
@@ -54,6 +54,14 @@ Optional cleaner routes can also be configured:
54
54
*`/oauth2/authorize`
55
55
*`/oauth2/token`
56
56
57
+
## When is a client secret shown?
58
+
59
+
For confidential clients, the client secret is shown in full only when the client is created or when the secret is rotated. After that, the secret is masked in the UI.
60
+
61
+
## Can I rotate a client secret?
62
+
63
+
Yes. Confidential clients support secret rotation from the edit screen. Rotate the secret if you need a new value or if the existing one may have been exposed.
64
+
57
65
## Can I still use `token_auth`?
58
66
59
-
Yes. The OAuth2 plugin adds an alternative authentication method for external applications. Existing `token_auth` based integrations continue to be relevant for Matomo installations where the plugin is not enabled.
67
+
Yes. The OAuth 2.0 plugin adds an alternative authentication method for external applications. Existing `token_auth` based integrations continue to be relevant for Matomo installations where the plugin is not enabled.
Copy file name to clipboardExpand all lines: docs/5.x/oauth2/setup.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
category: Integrate
3
-
title: OAuth2 Setup
3
+
title: OAuth 2.0 Setup
4
4
---
5
-
# Setting up OAuth2
5
+
# Setting up OAuth 2.0
6
6
7
7
In this guide you will learn how to configure an OAuth client so an external application can request access tokens for Matomo.
8
8
9
-
## What the OAuth2 plugin provides
9
+
## What the OAuth 2.0 plugin provides
10
10
11
-
The plugin adds a first-party OAuth2 Authorization Server to Matomo. Once enabled, applications can authenticate against Matomo using bearer tokens instead of sharing a permanent `token_auth`.
11
+
The plugin adds a first-party OAuth 2.0 Authorization Server to Matomo. Once enabled, applications can authenticate against Matomo using bearer tokens instead of sharing a permanent `token_auth`.
12
12
13
13
The plugin supports these grant types:
14
14
@@ -25,9 +25,11 @@ The plugin currently supports these scopes:
25
25
26
26
See the [permissions guide](/guides/permissions) for more information.
27
27
28
-
## OAuth endpoints
28
+
Access tokens are sent as bearer tokens when calling Matomo APIs. The plugin uses RSA keys to sign JWT access tokens.
29
29
30
-
Matomo exposes these OAuth2 endpoints:
30
+
## OAuth 2.0 endpoints
31
+
32
+
Matomo exposes these OAuth 2.0 endpoints:
31
33
32
34
| Endpoint | Description |
33
35
|--------|-------------|
@@ -57,11 +59,15 @@ Create a client and configure:
57
59
* The allowed scopes
58
60
* The redirect URI for the Authorization Code flow
59
61
62
+
From the client list, you can pause or resume a client, open it for editing, or delete it. For confidential clients, secret rotation is available from the edit screen.
63
+
60
64
You can create either of these client types:
61
65
62
66
***Confidential** clients, which use a client secret
63
67
***Public** clients, which do not use a client secret and should use PKCE
64
68
69
+
Client secrets are shown in full only when a confidential client is created or when its secret is rotated. After that, the secret is masked and you need to rotate it again if you want a new value.
70
+
65
71
Example client:
66
72
67
73
```text
@@ -76,6 +82,8 @@ Use a **public** client when your application cannot safely store a client secre
76
82
77
83
Use a **confidential** client when your application runs on a trusted backend and can safely keep the client secret private.
78
84
85
+
At the time of writing, the plugin allows only one scope per request and the requested scope needs to match the client configuration.
86
+
79
87
## What to read next
80
88
81
89
Once your client is configured, continue with the [Authorization Code guide](/guides/oauth2/authorization-code) or the [Client Credentials guide](/guides/oauth2/client-credentials).
Copy file name to clipboardExpand all lines: docs/5.x/querying-the-reporting-api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ If you want to request data in any language (PHP, Python, Ruby, ASP, C++, Java,
17
17
If the API call requires the token_auth and the HTTP request is sent over untrusted networks, we highly advise that you use an encrypted request. Otherwise, your token\_auth is exposed to eavesdroppers. This can be done by using https instead of http.
18
18
</div>
19
19
20
-
If the [OAuth2](/guides/oauth2) plugin is installed, external applications can also authenticate using OAuth2 bearer tokens instead of sending a `token_auth`. The examples below continue to use `token_auth` because it is available in every Matomo installation.
20
+
If the [OAuth 2.0](/guides/oauth2) plugin is installed, external applications can also authenticate using OAuth 2.0 bearer tokens instead of sending a `token_auth`. The examples below continue to use `token_auth` because it is available in every Matomo installation.
21
21
22
22
You can, for example, get the list of countries where most of your visitors in the current month are from. Here is an example in PHP:
0 commit comments