1
1
package com .authsignal .keycloak ;
2
2
3
3
import com .authsignal .AuthsignalClient ;
4
+ import com .authsignal .model .TrackAttributes ;
4
5
import com .authsignal .model .TrackRequest ;
5
6
import com .authsignal .model .TrackResponse ;
6
7
import com .authsignal .model .UserActionState ;
@@ -74,9 +75,11 @@ public void authenticate(AuthenticationFlowContext context) {
74
75
request .action = actionCode (context );
75
76
76
77
request .userId = context .getUser ().getId ();
77
- request .redirectUrl = redirectUrl ;
78
- request .ipAddress = context .getConnection ().getRemoteAddr ();
79
- request .userAgent = context .getHttpRequest ().getHttpHeaders ().getHeaderString ("User-Agent" );
78
+ request .attributes = new TrackAttributes ();
79
+ request .attributes .redirectUrl = redirectUrl ;
80
+ request .attributes .ipAddress = context .getConnection ().getRemoteAddr ();
81
+ request .attributes .userAgent =
82
+ context .getHttpRequest ().getHttpHeaders ().getHeaderString ("User-Agent" );
80
83
81
84
try {
82
85
CompletableFuture <TrackResponse > responseFuture = authsignalClient .track (request );
@@ -90,7 +93,8 @@ public void authenticate(AuthenticationFlowContext context) {
90
93
91
94
boolean isEnrolled = response .isEnrolled ;
92
95
93
- // If the user is not enrolled (has no authenticators) and enrollment by default is enabled,
96
+ // If the user is not enrolled (has no authenticators) and enrollment by default
97
+ // is enabled,
94
98
// display the challenge page to allow the user to enroll.
95
99
if (enrolByDefault (context ) && !isEnrolled ) {
96
100
if (response .state == UserActionState .BLOCK ) {
0 commit comments