File tree Expand file tree Collapse file tree 5 files changed +28
-10
lines changed
main/java/org/privacyidea
test/java/org/privacyidea Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 6262 <dependency >
6363 <groupId >junit</groupId >
6464 <artifactId >junit</artifactId >
65- <version >4.13.1 </version >
65+ <version >4.13.2 </version >
6666 <scope >test</scope >
6767 </dependency >
6868
6969 <dependency >
7070 <groupId >com.squareup.okhttp3</groupId >
7171 <artifactId >okhttp</artifactId >
72- <version >4.9.0 </version >
72+ <version >4.9.3 </version >
7373 </dependency >
7474
7575 <dependency >
7676 <groupId >com.google.code.gson</groupId >
7777 <artifactId >gson</artifactId >
78- <version >2.8.6 </version >
78+ <version >2.9.0 </version >
7979 </dependency >
8080
8181 <dependency >
8282 <groupId >org.mock-server</groupId >
8383 <artifactId >mockserver-junit-rule</artifactId >
84- <version >5.11.1 </version >
84+ <version >5.12.0 </version >
8585 <scope >test</scope >
8686 </dependency >
8787
8888 <dependency >
8989 <groupId >org.slf4j</groupId >
9090 <artifactId >slf4j-simple</artifactId >
91- <version >1.6.1</version >
91+ <version >1.7.36</version >
92+ </dependency >
93+
94+ <!-- Needed for MockServer if JDK >=16 -->
95+ <dependency >
96+ <groupId >org.bouncycastle</groupId >
97+ <artifactId >bcprov-jdk15on</artifactId >
98+ <version >1.70</version >
99+ <scope >test</scope >
100+ </dependency >
101+
102+ <dependency >
103+ <groupId >org.bouncycastle</groupId >
104+ <artifactId >bcpkix-jdk15on</artifactId >
105+ <version >1.70</version >
106+ <scope >test</scope >
92107 </dependency >
93108
94109 </dependencies >
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ public PIResponse parsePIResponse(String serverResponse)
151151 return response ;
152152 }
153153
154- response .id = getString (obj , ID );
154+ response .id = getInt (obj , ID );
155155 response .piVersion = getString (obj , VERSION_NUMBER );
156156 response .signature = getString (obj , SIGNATURE );
157157 response .jsonRPCVersion = getString (obj , JSONRPC );
Original file line number Diff line number Diff line change 2222import java .util .function .Predicate ;
2323import java .util .stream .Collectors ;
2424
25- import static org .privacyidea .AuthenticationStatus .NONE ;
2625import static org .privacyidea .PIConstants .TOKEN_TYPE_PUSH ;
2726import static org .privacyidea .PIConstants .TOKEN_TYPE_U2F ;
2827import static org .privacyidea .PIConstants .TOKEN_TYPE_WEBAUTHN ;
@@ -37,11 +36,11 @@ public class PIResponse
3736 public List <Challenge > multichallenge = new ArrayList <>();
3837 public String transactionID = "" ;
3938 public String serial = "" ;
40- public String id = "" ;
39+ public int id = 0 ;
4140 public String jsonRPCVersion = "" ;
4241 public boolean status = false ;
4342 public boolean value = false ;
44- public AuthenticationStatus authentication = NONE ;
43+ public AuthenticationStatus authentication = AuthenticationStatus . NONE ;
4544 public String piVersion = "" ; // e.g. 3.2.1
4645 public String rawMessage = "" ;
4746 public String signature = "" ;
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public void testOTPSuccess() {
6565 " \" id\" : 1,\n " +
6666 " \" jsonrpc\" : \" 2.0\" ,\n " +
6767 " \" result\" : {\n " +
68+ " \" authentication\" : \" ACCEPT\" ,\n " +
6869 " \" status\" : true,\n " +
6970 " \" value\" : true\n " +
7071 " },\n " +
@@ -78,7 +79,7 @@ public void testOTPSuccess() {
7879 PIResponse response = privacyIDEA .validateCheck (username , otp );
7980
8081 // Assert everything
81- assertEquals ("1" , response .id );
82+ assertEquals (1 , response .id );
8283 assertEquals ("matching 1 tokens" , response .message );
8384 assertEquals (6 , response .otpLength );
8485 assertEquals ("PISP0001C673" , response .serial );
@@ -94,6 +95,7 @@ public void testOTPSuccess() {
9495 // result
9596 assertTrue (response .status );
9697 assertTrue (response .value );
98+ assertEquals (AuthenticationStatus .ACCEPT , response .authentication );
9799 }
98100
99101 @ Test
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ public void test() {
131131 " \" id\" : 1,\n " +
132132 " \" jsonrpc\" : \" 2.0\" ,\n " +
133133 " \" result\" : {\n " +
134+ " \" authentication\" : \" CHALLENGE\" ,\n " +
134135 " \" status\" : true,\n " +
135136 " \" value\" : false\n " +
136137 " },\n " +
@@ -142,6 +143,7 @@ public void test() {
142143
143144 Optional <Challenge > opt = response .multiChallenge ().stream ().filter (challenge -> TOKEN_TYPE_WEBAUTHN .equals (challenge .getType ())).findFirst ();
144145 assertTrue (opt .isPresent ());
146+ assertEquals (AuthenticationStatus .CHALLENGE , response .authentication );
145147 Challenge a = opt .get ();
146148 if (a instanceof WebAuthn ) {
147149 WebAuthn b = (WebAuthn ) a ;
You can’t perform that action at this time.
0 commit comments