File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/main/java/nl/wouterh/keycloak/trusteddevice/authenticator Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 2222import org .keycloak .common .util .Time ;
2323import org .keycloak .credential .CredentialModel ;
2424import org .keycloak .credential .CredentialProvider ;
25+ import org .keycloak .models .AuthenticatorConfigModel ;
2526import org .keycloak .models .KeycloakSession ;
2627import org .keycloak .models .RealmModel ;
2728import org .keycloak .models .UserModel ;
@@ -67,9 +68,15 @@ public void action(AuthenticationFlowContext context) {
6768 return ;
6869 }
6970
70- Map <String , String > config = context .getAuthenticatorConfig ().getConfig ();
71- Duration duration = Strings .isNullOrEmpty (config .get (CONF_DURATION )) ? null
72- : Duration .parse (config .get (CONF_DURATION ));
71+ Duration duration = null ;
72+
73+ AuthenticatorConfigModel authenticatorConfig = context .getAuthenticatorConfig ();
74+ if (authenticatorConfig != null ) {
75+ Map <String , String > config = authenticatorConfig .getConfig ();
76+ if (config != null && !Strings .isNullOrEmpty (config .get (CONF_DURATION ))) {
77+ duration = Duration .parse (config .get (CONF_DURATION ));
78+ }
79+ }
7380
7481 MultivaluedMap <String , String > formParameters = context .getHttpRequest ()
7582 .getDecodedFormParameters ();
You can’t perform that action at this time.
0 commit comments