Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTM-1161: Add authentication event logging #976

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

matthijsln
Copy link
Contributor

@matthijsln matthijsln commented Oct 7, 2024

HTM-1161 Powered by Pull Request Badge

Example log messages:

o.t.api.security.AuthenticationEvents    : Authentication successful for user "tm-admin", granted authorities: [admin, test-bar], via login form
o.t.api.security.AuthenticationEvents    : Authentication failure: Bad credentials  for user "tm-admin"
o.t.api.security.AuthenticationEvents    : OAuth2 authentication failure: [invalid_token_response] An error occurred while attempting to retrieve the OAuth 2.0 Access Token Response: 401 Unauthorized: [no body], org.tailormap.api.security.events.OAuth2AuthenticationFailureEvent[source=OAuth2LoginAuthenticationToken [Principal=null, Credentials=[PROTECTED], Authenticated=false, Details=WebAuthenticationDetails [RemoteIpAddress=127.0.0.1, SessionId=FC9869FEFC15EE2C0B079F309D1C83B2], Granted Authorities=[]]]
o.t.api.security.AuthenticationEvents    : Authentication successful for user "Test User", granted authorities: [OIDC_USER, SCOPE_openid, SCOPE_email, voorbeeld-groep, admin, SCOPE_profile], via OIDC registration "Entra" with client ID fffffff-aaaa-bbbb-cccc-dddddddddddd, user claims: {sub=xxx, name=Test User, given_name=Test, family_name=User, picture=https://graph.microsoft.com/v1.0/me/photo/$value, [email protected]}

@matthijsln matthijsln self-assigned this Oct 7, 2024
@matthijsln matthijsln added the enhancement New feature or request label Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 18.18182% with 36 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...g/tailormap/api/security/AuthenticationEvents.java 9% 32 Missing ⚠️
...rity/events/DefaultAuthenticationFailureEvent.java 0% 2 Missing ⚠️
...urity/events/OAuth2AuthenticationFailureEvent.java 0% 2 Missing ⚠️

Impacted file tree graph

@@          Coverage Diff          @@
##             main   #976   +/-   ##
=====================================
- Coverage      78%    78%   -0%     
  Complexity     78     78           
=====================================
  Files         100    103    +3     
  Lines        4676   4720   +44     
  Branches      433    439    +6     
=====================================
+ Hits         3631   3639    +8     
- Misses        816    852   +36     
  Partials      229    229           
Files with missing lines Coverage Δ Complexity Δ
...ilormap/api/security/ApiSecurityConfiguration.java 56% <100%> (+3%) 0 <0> (ø)
...rity/events/DefaultAuthenticationFailureEvent.java 0% <0%> (ø) 0 <0> (?)
...urity/events/OAuth2AuthenticationFailureEvent.java 0% <0%> (ø) 0 <0> (?)
...g/tailormap/api/security/AuthenticationEvents.java 9% <9%> (ø) 0 <0> (?)

Copy link

github-actions bot commented Oct 7, 2024

Test Results

277 tests  ±0   276 ✅ ±0   3m 22s ⏱️ +29s
 29 suites ±0     1 💤 ±0 
 29 files   ±0     0 ❌ ±0 

Results for commit 136558b. ± Comparison against base commit 1b3b630.

♻️ This comment has been updated with latest results.

@matthijsln matthijsln marked this pull request as ready for review October 10, 2024 13:12
@mprins mprins enabled auto-merge (squash) October 10, 2024 14:28
@mprins mprins merged commit d2148ac into main Oct 10, 2024
24 of 25 checks passed
@mprins mprins deleted the HTM-1161/authentication-events-logging branch October 10, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants