Skip to content

Commit 4ef5021

Browse files
Merge pull request #5730 from wso2/fixing-product-is-issue-19367-1764054707
Fix: Add OAuth 2.0 Transaction Logs documentation for all affected versions (Product IS issue #19367)
2 parents fb6f204 + a8c1621 commit 4ef5021

File tree

9 files changed

+63
-0
lines changed

9 files changed

+63
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "../../../../../includes/deploy/monitor/oauth-transaction-logs.md" %}

en/identity-server/7.0.0/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ nav:
857857
- Monitor logs:
858858
- Overview: deploy/monitor/monitor-logs.md
859859
- HTTP access logs: deploy/monitor/http-access-logging.md
860+
- OAuth transaction logs: deploy/monitor/oauth-transaction-logs.md
860861
- Remote log publishing: deploy/monitor/remote-log-publishing.md
861862
- Mask sensitive info:
862863
- Overview: deploy/monitor/mask-sensitive-information-in-logs.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "../../../../../includes/deploy/monitor/oauth-transaction-logs.md" %}

en/identity-server/7.1.0/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,7 @@ nav:
932932
- Monitor logs:
933933
- Overview: deploy/monitor/monitor-logs.md
934934
- HTTP access logs: deploy/monitor/http-access-logging.md
935+
- OAuth transaction logs: deploy/monitor/oauth-transaction-logs.md
935936
- Remote log publishing: deploy/monitor/remote-log-publishing.md
936937
- Mask sensitive info:
937938
- Overview: deploy/monitor/mask-sensitive-information-in-logs.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "../../../../../includes/deploy/monitor/oauth-transaction-logs.md" %}

en/identity-server/7.2.0/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ nav:
992992
- Monitor logs:
993993
- Overview: deploy/monitor/monitor-logs.md
994994
- HTTP access logs: deploy/monitor/http-access-logging.md
995+
- OAuth transaction logs: deploy/monitor/oauth-transaction-logs.md
995996
- Remote log publishing: deploy/monitor/remote-log-publishing.md
996997
- Mask sensitive info:
997998
- Overview: deploy/monitor/mask-sensitive-information-in-logs.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "../../../../../includes/deploy/monitor/oauth-transaction-logs.md" %}

en/identity-server/next/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ nav:
993993
- Monitor logs:
994994
- Overview: deploy/monitor/monitor-logs.md
995995
- HTTP access logs: deploy/monitor/http-access-logging.md
996+
- OAuth transaction logs: deploy/monitor/oauth-transaction-logs.md
996997
- Remote log publishing: deploy/monitor/remote-log-publishing.md
997998
- Mask sensitive info:
998999
- Overview: deploy/monitor/mask-sensitive-information-in-logs.md
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# OAuth transaction logs
2+
3+
OAuth transaction logs allow you to audit and monitor OAuth 2.0 activities in {{product_name}}, such as token generation and token introspection operations. While optional, these logs provide support for auditing, troubleshooting failed requests, or tracking OAuth activity across different clients and users.
4+
5+
## Enable OAuth transaction logging
6+
7+
To enable logging for OAuth endpoints:
8+
9+
1. Add the following event lister to the `<IS_HOME>/repository/conf/deployment.toml` file:
10+
11+
!!! tip
12+
You can disable logging at any time by setting the `enable` property to **false**.
13+
14+
```toml
15+
[event.default_listener.oauth_listener]
16+
priority = 12
17+
enable = true
18+
```
19+
20+
2. Restart WSO2 Identity Server. Once the changes apply, a new file named `transaction.log` gets created in the `<IS_HOME>/repository/logs/` folder.
21+
22+
## Understand transaction logs
23+
24+
The following examples illustrate sample entries in the OAuth transaction logs logged in the `transaction.log` file.
25+
26+
### OAuth token generation log
27+
28+
```text
29+
[2018-10-17 19:05:35,578] - Type: OAUTH TOKEN | Info: {
30+
"expires_in_seconds": 3126,
31+
"grant_type": "client_credentials",
32+
"success": true,
33+
"time_taken_in_millis": 38,
34+
"type": "oauth",
35+
"issued_time": 1539782861654,
36+
"user": "admin@carbon.super",
37+
"client_id": "WImdsCviCHTXVjjef7VVMiYDxJAa"
38+
}
39+
```
40+
41+
### OAuth token introspection log
42+
43+
```text
44+
45+
[2018-10-17 19:05:48,654] - Type: OAUTH INTROSPECTION | Info: {
46+
"expires_in_seconds": 3113,
47+
"success": true,
48+
"time_taken_in_millis": 2,
49+
"issued_time": 1539782861,
50+
"type": "introspection",
51+
"user": "admin@carbon.super",
52+
"client_id": "WImdsCviCHTXVjjef7VVMiYDxJAa",
53+
"token": "6cc57770-a51c-3d6d-be62-49caa0c1217b"
54+
}
55+
```

0 commit comments

Comments
 (0)