2525
2626import static org .privacyidea .PIConstants .TOKEN_TYPE_PUSH ;
2727import static org .privacyidea .PIConstants .TOKEN_TYPE_WEBAUTHN ;
28+ import static org .privacyidea .PIConstants .CONTAINER_TYPE_SMARTPHONE ;
2829
2930
3031/**
@@ -53,8 +54,8 @@ public class PIResponse
5354 public PIError error = null ;
5455 // Passkey content is json string and can be passed to the browser as is
5556 public String passkeyChallenge = "" ;
56- public String passkeyMessage = "" ;
5757 public String passkeyRegistration = "" ;
58+ public String passkeyMessage = "" ;
5859 public String username = "" ;
5960 public String enrollmentLink = "" ;
6061 // Enroll via Multichallenge
@@ -83,7 +84,11 @@ public boolean authenticationSuccessful()
8384 */
8485 public boolean pushAvailable ()
8586 {
86- return multiChallenge .stream ().anyMatch (c -> TOKEN_TYPE_PUSH .equals (c .getType ()));
87+ return multiChallenge .stream ().anyMatch (c -> isPushOrSmartphoneContainer (c .getType ()));
88+ }
89+
90+ private boolean isPushOrSmartphoneContainer (String type ) {
91+ return TOKEN_TYPE_PUSH .equals (type ) || CONTAINER_TYPE_SMARTPHONE .equals (type );
8792 }
8893
8994 /**
@@ -93,14 +98,14 @@ public boolean pushAvailable()
9398 */
9499 public String pushMessage ()
95100 {
96- return reduceChallengeMessagesWhere (c -> TOKEN_TYPE_PUSH . equals (c .getType ()));
101+ return reduceChallengeMessagesWhere (c -> isPushOrSmartphoneContainer (c .getType ()));
97102 }
98103
99104 public String otpTransactionId ()
100105 {
101106 for (Challenge challenge : multiChallenge )
102107 {
103- if (!TOKEN_TYPE_PUSH . equals (challenge .getType ()) && !TOKEN_TYPE_WEBAUTHN .equals (challenge .getType ()))
108+ if (!isPushOrSmartphoneContainer (challenge .getType ()) && !TOKEN_TYPE_WEBAUTHN .equals (challenge .getType ()))
104109 {
105110 return challenge .transactionID ;
106111 }
@@ -111,7 +116,7 @@ public String otpTransactionId()
111116 public String pushTransactionId () {
112117 for (Challenge challenge : multiChallenge )
113118 {
114- if (TOKEN_TYPE_PUSH . equals (challenge .getType ()))
119+ if (isPushOrSmartphoneContainer (challenge .getType ()))
115120 {
116121 return challenge .transactionID ;
117122 }
@@ -126,7 +131,7 @@ public String pushTransactionId() {
126131 */
127132 public String otpMessage ()
128133 {
129- return reduceChallengeMessagesWhere (c -> !(TOKEN_TYPE_PUSH . equals (c .getType ())));
134+ return reduceChallengeMessagesWhere (c -> !(isPushOrSmartphoneContainer (c .getType ())));
130135 }
131136
132137 private String reduceChallengeMessagesWhere (Predicate <Challenge > predicate )
0 commit comments