webauthn: name is optional in get credentials options for passkeys
@@ -240,10 +240,7 @@ public class WebAuthnHandlerImpl extends AuthenticationHandlerImpl<WebAuthn> imp
final JsonObject webauthnLogin = ctx.body().asJsonObject();
final Session session = ctx.session();
- if (webauthnLogin == null || !containsRequiredString(webauthnLogin, "name")) {
- ctx.fail(400, new IllegalArgumentException("Request missing 'name' field"));
- return;
- }
+ final String username = webauthnLogin == null ? null : webauthnLogin.getString("name");
// input basic validation is OK
@@ -252,8 +249,6 @@ public class WebAuthnHandlerImpl extends AuthenticationHandlerImpl<WebAuthn> imp
return;
}
- final String username = webauthnLogin.getString("name");
-
// STEP 18 Generate assertion
authProvider.getCredentialsOptions(username, generateServerGetAssertion -> {
if (generateServerGetAssertion.failed()) {
