File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
types-api/src/main/java/pl/edu/icm/unity/types/authn Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -47,14 +47,17 @@ public AuthenticationOptionsSelector(JsonNode json)
4747 if (json .isTextual ())
4848 {
4949 String [] specs = json .asText ().split ("\\ ." );
50+ if (specs .length != 2 )
51+ throw new IllegalArgumentException ("Invalid selector format: " + json .toString ());
5052 this .authenticatorKey = specs [0 ];
5153 this .optionKey = specs [1 ];
5254 } else
5355 {
5456 if (!JsonUtil .notNull (json , "authenticatorKey" ))
5557 throw new IllegalArgumentException ("Expecting authenticatorKey in json object: " + json .toString ());
5658 if (!JsonUtil .notNull (json , "optionKey" ))
57- throw new IllegalArgumentException ("Expecting authenticatorKey in json object: " + json .toString ());
59+ throw new IllegalArgumentException ("Expecting optionKey in json object: " + json .toString ());
60+
5861 this .authenticatorKey = JsonUtil .getWithDef (json , "authenticatorKey" , null );
5962 this .optionKey = JsonUtil .getWithDef (json , "optionKey" , null );
6063 }
You can’t perform that action at this time.
0 commit comments