diff --git a/build.gradle b/build.gradle index a0785c0d5..1a4154a96 100644 --- a/build.gradle +++ b/build.gradle @@ -74,7 +74,10 @@ dependencies { implementation group: 'com.googlecode.libphonenumber', name: 'libphonenumber', version: '8.13.25' // https://mvnrepository.com/artifact/com.webauthn4j/webauthn4j-core - implementation group: 'com.webauthn4j', name: 'webauthn4j-core', version: '0.28.3.RELEASE' + implementation group: 'com.webauthn4j', name: 'webauthn4j-core', version: '0.28.5.RELEASE' + + // https://mvnrepository.com/artifact/com.webauthn4j/webauthn4j-test + implementation group: 'com.webauthn4j', name: 'webauthn4j-test', version: '0.28.5.RELEASE' compileOnly project(":supertokens-plugin-interface") testImplementation project(":supertokens-plugin-interface") @@ -89,7 +92,6 @@ dependencies { testImplementation group: 'org.reflections', name: 'reflections', version: '0.9.10' testImplementation 'com.tngtech.archunit:archunit-junit4:0.22.0' - } application { diff --git a/implementationDependencies.json b/implementationDependencies.json index 1a18f9555..500b88ea4 100644 --- a/implementationDependencies.json +++ b/implementationDependencies.json @@ -117,9 +117,14 @@ "src": "https://repo1.maven.org/maven2/com/googlecode/libphonenumber/libphonenumber/8.13.25/libphonenumber-8.13.25-sources.jar" }, { - "jar": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-core/0.28.3.RELEASE/webauthn4j-core-0.28.3.RELEASE.jar", + "jar": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-core/0.28.3.RELEASE/webauthn4j-core-0.28.5.RELEASE.jar", "name": "webauthn4j-core 0.28.3.RELEASE", - "src": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-core/0.28.3.RELEASE/webauthn4j-core-0.28.3.RELEASE-sources.jar" + "src": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-core/0.28.3.RELEASE/webauthn4j-core-0.28.5.RELEASE-sources.jar" + }, + { + "jar": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-test/0.28.5.RELEASE/webauthn4j-test-0.28.5.RELEASE.jar", + "name": "webauthn4j-test 0.28.5.RELEASE", + "src": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-test/0.28.5.RELEASE/webauthn4j-test-0.28.5.RELEASE-sources.jar" } ] } \ No newline at end of file diff --git a/src/test/java/io/supertokens/test/webauthn/WebAuthNFlowTest.java b/src/test/java/io/supertokens/test/webauthn/WebAuthNFlowTest.java index 8d6c4a8de..4fe990cfb 100644 --- a/src/test/java/io/supertokens/test/webauthn/WebAuthNFlowTest.java +++ b/src/test/java/io/supertokens/test/webauthn/WebAuthNFlowTest.java @@ -17,6 +17,9 @@ package io.supertokens.test.webauthn; import com.google.gson.JsonObject; +import com.webauthn4j.test.EmulatorUtil; +import com.webauthn4j.test.client.ClientPlatform; +import io.supertokens.Main; import io.supertokens.ProcessState; import io.supertokens.emailpassword.EmailPassword; import io.supertokens.featureflag.EE_FEATURES; @@ -28,6 +31,7 @@ import io.supertokens.test.TestingProcessManager; import io.supertokens.test.Utils; import io.supertokens.test.httpRequest.HttpRequestForTesting; +import io.supertokens.test.httpRequest.HttpResponseException; import io.supertokens.utils.SemVer; import org.junit.AfterClass; import org.junit.Before; @@ -35,6 +39,7 @@ import org.junit.Test; import org.junit.rules.TestRule; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Base64; @@ -42,6 +47,13 @@ public class WebAuthNFlowTest { + +// }, +// { +// "jar": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-test/0.28.5.RELEASE/webauthn4j-test-0.28.5.RELEASE.jar", +// "name": "webauthn4j-test 0.28.5.RELEASE", +// "src": "https://repo1.maven.org/maven2/com/webauthn4j/webauthn4j-test/0.28.5.RELEASE/webauthn4j-test-0.28.5.RELEASE-sources.jar" + @Rule public TestRule watchman = Utils.getOnFailure(); @@ -129,6 +141,21 @@ public void optionsRegisterAPITest() throws Exception { System.out.println(signupResponse.toString()); } + private JsonObject registerOptions(Main main, String email) throws HttpResponseException, IOException { + JsonObject requestBody = new JsonObject(); + requestBody.addProperty("email",email); + requestBody.addProperty("relyingPartyName","supertokens.com"); + requestBody.addProperty("relyingPartyId","supertokens.com"); + requestBody.addProperty("origin","supertokens.com"); + requestBody.addProperty("timeout",10000); + + JsonObject response = HttpRequestForTesting.sendJsonPOSTRequest(main, "", + "http://localhost:3567/recipe/webauthn/options/register", + requestBody, 10000, 10000, null, SemVer.v5_2.get(), null); + + return response; + } + @Test public void signUpFlow() throws Exception { String[] args = {"../"}; @@ -139,5 +166,7 @@ public void signUpFlow() throws Exception { process.startProcess(); assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); + ClientPlatform clientPlatform = EmulatorUtil.createClientPlatform(); + } }