[java-idp-plugin-webauthn] branch main updated: Fix plugin packaging
Phil Smart
philip.smart at jisc.ac.uk
Tue Dec 12 14:55:53 UTC 2023
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=29d1efe782de7f40bf9f2ee25ad48896ac02125b
The following commit(s) were added to refs/heads/main by this push:
new 29d1efe Fix plugin packaging
29d1efe is described below
commit 29d1efe782de7f40bf9f2ee25ad48896ac02125b
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Dec 12 14:55:49 2023 +0000
Fix plugin packaging
- Cleanup packages
- Remove redundant classes
- Should be installable and runnable
---
pom.xml | 19 +++
webauthn-api/pom.xml | 33 +++-
.../plugin/authn/webauthn/CredentialPublicKey.java | 98 ------------
.../plugin/authn/webauthn/PublicKeyCredential.java | 79 ----------
.../idp/plugin/authn/webauthn/Response.java | 64 --------
.../idp/plugin/authn/webauthn/Version.java | 32 ----
.../{ => client}/WebAuthnAuthenticationClient.java | 6 +-
.../WebauthnAuthenticationClientFactory.java | 5 +-
.../{ => exception}/AssertionFailureException.java | 2 +-
.../RegistrationFailureException.java | 2 +-
.../WebAuthnAuthenticationClientException.java | 2 +-
webauthn-impl/pom.xml | 94 ++++++++++-
.../CreatePublicKeyCredentialCreationOptions.java | 6 +-
...actAuthenticatorAttestationFromFormRequest.java | 4 +-
.../webauthn/admin/impl/GenerateUserHandle.java | 2 +-
.../admin/impl/StorePublicKeyCredential.java | 2 +-
.../ValidateAuthenticatorAttestationResponse.java | 4 +-
.../impl/YubicoWebauthnAuthenticationClient.java | 8 +-
.../client/impl/YubicoWebauthnClientFactory.java | 2 +-
.../AbstractWebAuthnAuthenticationAction.java | 5 +-
.../webauthn/impl}/AbstractWebAuthnBaseAction.java | 3 +-
.../impl}/AbstractWebAuthnRegistrationAction.java | 3 +-
.../CreatePublicKeyCredentialRequestOptions.java | 5 +-
...tractAuthenticatorAssertionFromFormRequest.java | 1 -
.../webauthn/impl/GenerateServerChallenge.java | 1 -
.../webauthn/impl/LookupRegisteredCredentials.java | 1 -
.../webauthn/impl/ValidateWebAuthnAssertion.java | 4 +-
.../storage/impl/CredentialPublicKeyHolder.java | 91 -----------
.../webauthn-registration-flow.xml | 2 +-
.../idp/flows/authn/WebAuthn/webauthn-flow.xml | 2 +-
.../authn/webauthn/conf/authn/webauthn.properties | 7 +-
.../idp/plugin/authn/webauthn/js/webauthn.js | 171 ---------------------
.../idp/plugin/authn/webauthn/module.properties | 27 ++++
.../plugin/authn/webauthn/views/webauthn-authn.vm | 2 +-
.../authn/webauthn/views/webauthn-register.vm | 6 +-
.../authn/webauthn/views/webauthn-registered.vm | 2 +-
.../YubicoWebauthnAuthenticationClientTest.java | 6 +-
.../impl/ValidatePublicKeyCredentialTest.java | 2 +-
38 files changed, 215 insertions(+), 590 deletions(-)
diff --git a/pom.xml b/pom.xml
index c5cd78a..0a01218 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,9 @@
<yubico-webauthn.version>2.5.0</yubico-webauthn.version>
<jackson-dataformat-cbor.verison>2.15.3</jackson-dataformat-cbor.verison>
<com-upokecenter.version>4.5.2</com-upokecenter.version>
+ <augustcellars-cose.version>1.1.0</augustcellars-cose.version>
+ <numbers.groupId>com.github.peteroupc</numbers.groupId>
+ <numbers.version>1.8.2</numbers.version>
<checkstyle.configLocation>
${project.basedir}/resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
</properties>
@@ -101,12 +104,28 @@
<artifactId>webauthn-server-core</artifactId>
<version>${yubico-webauthn.version}</version>
</dependency>
+ <dependency>
+ <groupId>${yubico.groupId}</groupId>
+ <artifactId>yubico-util</artifactId>
+ <version>${yubico-webauthn.version}</version>
+ </dependency>
<dependency>
<groupId>com.upokecenter</groupId>
<artifactId>cbor</artifactId>
<version>${com-upokecenter.version}</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>com.augustcellars.cose</groupId>
+ <artifactId>cose-java</artifactId>
+ <version>${augustcellars-cose.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${numbers.groupId}</groupId>
+ <artifactId>numbers</artifactId>
+ <version>${numbers.version}</version>
+ <scope>runtime</scope>
+ </dependency>
<!-- Import Dependencies: Shib-Metadata/Attribute/Profile/Shared -->
<dependency>
<groupId>${shib-shared.groupId}</groupId>
diff --git a/webauthn-api/pom.xml b/webauthn-api/pom.xml
index 39d2b7e..9287e55 100644
--- a/webauthn-api/pom.xml
+++ b/webauthn-api/pom.xml
@@ -25,7 +25,7 @@
distribution. -->
<!-- Provided dependencies -->
- <dependency>
+ <dependency>
<groupId>${idp.groupId}</groupId>
<artifactId>idp-authn-api</artifactId>
<scope>provided</scope>
@@ -40,6 +40,11 @@
<artifactId>jackson-datatype-jsr310</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>com.yubico</groupId>
<artifactId>webauthn-server-core</artifactId>
@@ -55,8 +60,28 @@
<artifactId>idp-admin-api</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-profile-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-messaging-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-profile-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib-shared.groupId}</groupId>
+ <artifactId>shib-support</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
-
+
<build>
<plugins>
<plugin>
@@ -65,7 +90,7 @@
<configuration>
<archive>
<index>true</index>
- <manifestEntries>
+ <manifestEntries>
<Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
</manifestEntries>
<manifestSections>
@@ -83,6 +108,6 @@
</plugin>
</plugins>
</build>
-
+
</project>
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/CredentialPublicKey.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/CredentialPublicKey.java
deleted file mode 100644
index db67b76..0000000
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/CredentialPublicKey.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.plugin.authn.webauthn;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.shared.logic.Constraint;
-
-/**
- * The public key portion of the asymmetric credential key pair created by the authenticator during registration.
- *
- * <p>This is stored and later used to validate assertions generated in authentication ceremonies.</p>
- */
-public class CredentialPublicKey {
-
- /**
- * Identifies the public key credential source and its authentication assertions. Generated by the
- * authenticator and is an opaque random byte array.
- */
- @Nonnull private final byte[] credentialId;
-
- /** The user ID as specified by the IdP that maps a credential public key to a user.*/
- @Nonnull private final byte[] userHandle;
-
- /** The COSE_Key encoded credential public key used to verify authentication assertions.*/
- @Nonnull private final byte[] publicKeyCose;
-
- /** The current signature count for this credential from the authenticator.*/
- private final long signatureCount;
-
- /**
- * Constructor.
- *
- * @param credentialId the identifier of the credential.
- * @param userHandle the user ID that maps this credential public key to a user.
- * @param publicKeyCose the public key in COSE_Key format
- * @param signatureCount the signature counter for this credential.
- */
- public CredentialPublicKey(@Nonnull final byte[] credId, @Nonnull final byte[] handle,
- @Nonnull final byte[] keyCose, final long signCount) {
- super();
- credentialId = Constraint.isNotNull(credId, "CredentialID can not be null");
- userHandle = Constraint.isNotNull(handle, "UserHandle can not be null");
- publicKeyCose = Constraint.isNotNull(keyCose, "PublicKey in COSE_Key format can not be null");
- signatureCount = signCount;
- }
-
- /**
- * Get the credential's identifier.
- *
- * @return the credentialId.
- */
- @Nonnull public byte[] getCredentialId() {
- return credentialId;
- }
-
- /**
- * Get the user handle of this identifier.
- *
- * @return the userHandle.
- */
- @Nonnull public byte[] getUserHandle() {
- return userHandle;
- }
-
- /**
- * Get the public key in COSE_Key format.
- *
- * @return the publicKeyCose.
- */
- @Nonnull public byte[] getPublicKeyCose() {
- return publicKeyCose;
- }
-
- /**
- * Get the signature count from the authenticator.
- *
- * @return the signatureCount.
- */
- public long getSignatureCount() {
- return signatureCount;
- }
-
-
-
-}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/PublicKeyCredential.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/PublicKeyCredential.java
deleted file mode 100644
index 4f42dba..0000000
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/PublicKeyCredential.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package net.shibboleth.idp.plugin.authn.webauthn;
-
-import javax.annotation.Nonnull;
-import javax.annotation.concurrent.Immutable;
-import javax.annotation.concurrent.ThreadSafe;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-
- at Immutable
- at ThreadSafe
- at JsonDeserialize(builder=PublicKeyCredential.Builder.class)
- at JsonIgnoreProperties(ignoreUnknown = true)
- at Deprecated
-public final class PublicKeyCredential {
-
- @Nonnull private final String type;
-
- @Nonnull private final String id;
-
- @Nonnull private final Response response;
-
- //no clientExtensionResults?
-
-
- private PublicKeyCredential(final Builder builder) {
- this.type = builder.type;
- this.id = builder.id;
- this.response = builder.response;
- }
-
- /**
- * Creates builder to build {@link PublicKeyCredential}.
- * @return created builder
- */
-
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * Builder to build {@link PublicKeyCredential}.
- */
- @JsonPOJOBuilder(buildMethodName = "build",withPrefix = "with")
- @JsonIgnoreProperties(ignoreUnknown = true)
- public static final class Builder {
- private String type;
-
- private String id;
-
- private Response response;
-
- private Builder() {
- }
-
- public Builder withType(final String type) {
- this.type = type;
- return this;
- }
-
- public Builder withId(final String id) {
- this.id = id;
- return this;
- }
-
- public Builder withResponse(final Response response) {
- this.response = response;
- return this;
- }
-
- public PublicKeyCredential build() {
- return new PublicKeyCredential(this);
- }
- }
-
-
-
-}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/Response.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/Response.java
deleted file mode 100644
index 90e38bb..0000000
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/Response.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package net.shibboleth.idp.plugin.authn.webauthn;
-
-import javax.annotation.Nonnull;
-import javax.annotation.concurrent.Immutable;
-import javax.annotation.concurrent.ThreadSafe;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
- at Immutable
- at ThreadSafe
- at JsonDeserialize(builder=Response.Builder.class)
- at JsonIgnoreProperties(ignoreUnknown = true)
-public class Response {
-
- /** Base64 encoded attestation Object.*/
- //TODO should be a byte array converted from the b64 in the JSON
- @Nonnull private final String attestationObject;
-
- /** JSON client data base64 encoded.*/
- @Nonnull private final String clientDataJSON;
-
- private Response(Builder builder) {
- this.attestationObject = builder.attestationObject;
- this.clientDataJSON = builder.clientDataJSON;
- }
-
- /**
- * Creates builder to build {@link Response}.
- * @return created builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * Builder to build {@link Response}.
- */
- public static final class Builder {
- private String attestationObject;
-
- private String clientDataJSON;
-
- private Builder() {
- }
-
- public Builder withAttestationObject(String attestationObject) {
- this.attestationObject = attestationObject;
- return this;
- }
-
- public Builder withClientDataJSON(String clientDataJSON) {
- this.clientDataJSON = clientDataJSON;
- return this;
- }
-
- public Response build() {
- return new Response(this);
- }
- }
-
-
-
-}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/Version.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/Version.java
deleted file mode 100644
index 9441178..0000000
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/Version.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package net.shibboleth.idp.plugin.authn.webauthn;
-
-import javax.annotation.Nullable;
-
-/** Class for getting and printing the version of the plugin. */
-public final class Version {
-
- /** IdP version. */
- @Nullable private static final String VERSION = Version.class.getPackage().getImplementationVersion();
-
- /** Constructor. */
- private Version() {
- }
-
- /**
- * Main entry point to program.
- *
- * @param args command line arguments
- */
- public static void main(final String[] args) {
- System.out.println(VERSION);
- }
-
- /**
- * Get the version of the plugin.
- *
- * @return version of the plugin
- */
- @Nullable public static String getVersion() {
- return VERSION;
- }
-}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnAuthenticationClient.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java
similarity index 94%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnAuthenticationClient.java
rename to webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java
index 35ffa11..701a4d2 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnAuthenticationClient.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClient.java
@@ -1,4 +1,4 @@
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.client;
import java.util.List;
import java.util.Set;
@@ -18,6 +18,10 @@ import com.yubico.webauthn.data.PublicKeyCredentialCreationOptions;
import com.yubico.webauthn.data.PublicKeyCredentialDescriptor;
import com.yubico.webauthn.data.PublicKeyCredentialRequestOptions;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.AssertionFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.RegistrationFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.WebAuthnAuthenticationClientException;
+
/**
* A client that manages the entire webauthn authentication and registration ceremony.
*
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebauthnAuthenticationClientFactory.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebauthnAuthenticationClientFactory.java
similarity index 69%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebauthnAuthenticationClientFactory.java
rename to webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebauthnAuthenticationClientFactory.java
index b0193b6..dd912a0 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebauthnAuthenticationClientFactory.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebauthnAuthenticationClientFactory.java
@@ -1,7 +1,10 @@
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.client;
import javax.annotation.Nonnull;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.WebAuthnAuthenticationClientException;
+
/**
* Abstract factory for creating singleton {@link WebAuthnAuthenticationClient} instances.
*/
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AssertionFailureException.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/AssertionFailureException.java
similarity index 96%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AssertionFailureException.java
rename to webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/AssertionFailureException.java
index a678eaa..25fa6b9 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AssertionFailureException.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/AssertionFailureException.java
@@ -12,7 +12,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.exception;
/**
* Exception that is throw if an assertion is not valid.
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/RegistrationFailureException.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/RegistrationFailureException.java
similarity index 96%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/RegistrationFailureException.java
rename to webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/RegistrationFailureException.java
index ec6731a..7ed0b4e 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/RegistrationFailureException.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/RegistrationFailureException.java
@@ -12,7 +12,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.exception;
/**
* Exception that is throw if a public key credential registration is not valid.
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnAuthenticationClientException.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java
similarity index 94%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnAuthenticationClientException.java
rename to webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java
index 0a876a5..b1744ac 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/WebAuthnAuthenticationClientException.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/exception/WebAuthnAuthenticationClientException.java
@@ -1,4 +1,4 @@
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.exception;
/**
* An exception to signal an error condition during execution or creation of a Webauthn client.
diff --git a/webauthn-impl/pom.xml b/webauthn-impl/pom.xml
index 05f633b..b916b3e 100644
--- a/webauthn-impl/pom.xml
+++ b/webauthn-impl/pom.xml
@@ -31,24 +31,63 @@
<artifactId>webauthn-server-core</artifactId>
<scope>compile</scope>
</dependency>
- <dependency> <!-- note when we move to more yubico libs this will need to
- be runtime -->
- <groupId>com.upokecenter</groupId>
- <artifactId>cbor</artifactId>
- <scope>compile</scope>
- </dependency>
<!-- Runtime dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.datatype</groupId>
+ <artifactId>jackson-datatype-jdk8</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.upokecenter</groupId>
+ <artifactId>cbor</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.yubico</groupId>
+ <artifactId>yubico-util</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.peteroupc</groupId>
+ <artifactId>numbers</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.augustcellars.cose</groupId>
+ <artifactId>cose-java</artifactId>
+ <scope>runtime</scope>
+ </dependency>
<!-- Service API and Plugin Description dependencies -->
+ <dependency>
+ <groupId>${spring-webflow.groupId}</groupId>
+ <artifactId>spring-webflow</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>${idp.groupId}</groupId>
<artifactId>idp-admin-api</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-profile-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-session-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>${idp.groupId}</groupId>
<artifactId>idp-admin-impl</artifactId>
@@ -65,6 +104,21 @@
<scope>provided</scope>
</dependency>
<!-- Provided dependencies -->
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-authn-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib-shared.groupId}</groupId>
+ <artifactId>shib-support</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-profile-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
@@ -85,12 +139,38 @@
<artifactId>jackson-datatype-jsr310</artifactId>
<scope>provided</scope>
</dependency>
- <!-- TODO we should not need this for the cache long term if we switch out the storage-->
+ <!-- TODO we should not need this for the cache long term if we switch
+ out the storage-->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-messaging-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-storage-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-profile-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- Test dependencies -->
<dependency>
<groupId>${idp.groupId}</groupId>
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
index 304d02b..3b1ca61 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/CreatePublicKeyCredentialCreationOptions.java
@@ -32,10 +32,10 @@ import com.yubico.webauthn.data.PublicKeyCredentialCreationOptions;
import com.yubico.webauthn.data.PublicKeyCredentialDescriptor;
import net.shibboleth.idp.authn.AuthnEventIds;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnRegistrationAction;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClient;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClientException;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.WebAuthnAuthenticationClientException;
+import net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnRegistrationAction;
import net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRegistration;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractAuthenticatorAttestationFromFormRequest.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractAuthenticatorAttestationFromFormRequest.java
index 5956c7d..914b452 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractAuthenticatorAttestationFromFormRequest.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ExtractAuthenticatorAttestationFromFormRequest.java
@@ -33,8 +33,8 @@ import com.yubico.webauthn.data.PublicKeyCredential;
import jakarta.servlet.http.HttpServletRequest;
import net.shibboleth.idp.authn.AuthnEventIds;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnRegistrationAction;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnRegistrationAction;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -148,7 +148,7 @@ public class ExtractAuthenticatorAttestationFromFormRequest extends AbstractWebA
context.setAuthenticatorAttestationResponse(pkCredAttestation);
context.setCredentialNickname(credNickname);
} catch (final IOException e) {
- log.warn("{} Could not convert AuthenticatorAttestationResponse from form", getLogPrefix(), e);
+ log.warn("{} Could not convert AuthenticatorAttestationResponse from request parameter", getLogPrefix(), e);
ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.NO_CREDENTIALS);
return;
}
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/GenerateUserHandle.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/GenerateUserHandle.java
index 9b8bea7..cd16203 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/GenerateUserHandle.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/GenerateUserHandle.java
@@ -27,8 +27,8 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import net.shibboleth.idp.authn.AuthnEventIds;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnRegistrationAction;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnRegistrationAction;
import net.shibboleth.shared.primitive.LoggerFactory;
/**
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java
index df35521..2d788cb 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/StorePublicKeyCredential.java
@@ -39,9 +39,9 @@ import com.yubico.webauthn.data.ByteArray;
import com.yubico.webauthn.data.UserIdentity;
import net.shibboleth.idp.authn.AuthnEventIds;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnRegistrationAction;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnPublicKeyCredentialRecord;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnRegistrationAction;
import net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRegistration;
import net.shibboleth.idp.plugin.authn.webauthn.storage.impl.WebauthnPublicKeyCredentialStorageSerializer;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java
index b6becb0..3dd24fc 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/impl/ValidateAuthenticatorAttestationResponse.java
@@ -30,9 +30,9 @@ import com.yubico.webauthn.data.PublicKeyCredential;
import com.yubico.webauthn.data.PublicKeyCredentialCreationOptions;
import net.shibboleth.idp.authn.AuthnEventIds;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnRegistrationAction;
-import net.shibboleth.idp.plugin.authn.webauthn.RegistrationFailureException;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.RegistrationFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnRegistrationAction;
import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java
index f651a4f..c181c68 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClient.java
@@ -49,10 +49,10 @@ import com.yubico.webauthn.data.UserIdentity;
import com.yubico.webauthn.data.UserVerificationRequirement;
import com.yubico.webauthn.exception.RegistrationFailedException;
-import net.shibboleth.idp.plugin.authn.webauthn.AssertionFailureException;
-import net.shibboleth.idp.plugin.authn.webauthn.RegistrationFailureException;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClient;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClientException;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.AssertionFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.RegistrationFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.WebAuthnAuthenticationClientException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java
index 522c09c..8914421 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnClientFactory.java
@@ -26,7 +26,7 @@ import com.yubico.webauthn.CredentialRepository;
import com.yubico.webauthn.RelyingParty;
import com.yubico.webauthn.data.RelyingPartyIdentity;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClient;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.AbstractInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnAuthenticationAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java
similarity index 98%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnAuthenticationAction.java
rename to webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java
index d81e6ee..8c48cdd 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnAuthenticationAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.impl;
import java.util.function.Function;
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
import net.shibboleth.idp.authn.AbstractAuthenticationAction;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
@@ -132,7 +133,7 @@ public abstract class AbstractWebAuthnAuthenticationAction extends AbstractAuthe
ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_AUTHN_CTX);
return false;
- }
+ }
return doPreExecute(profileRequestContext, authenticationContext, webauthnContext);
}
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnBaseAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java
similarity index 98%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnBaseAction.java
rename to webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java
index 92b2c34..13d4548 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnBaseAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.impl;
import java.util.function.Function;
@@ -28,6 +28,7 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import net.shibboleth.idp.authn.context.AuthenticationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.context.BaseWebAuthnContext;
import net.shibboleth.idp.plugin.authn.webauthn.storage.StorageServiceCredentialRepository;
import net.shibboleth.idp.profile.AbstractProfileAction;
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnRegistrationAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnRegistrationAction.java
similarity index 98%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnRegistrationAction.java
rename to webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnRegistrationAction.java
index e3981c5..75a890c 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/AbstractWebAuthnRegistrationAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnRegistrationAction.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.plugin.authn.webauthn;
+package net.shibboleth.idp.plugin.authn.webauthn.impl;
import java.util.function.Function;
@@ -27,6 +27,7 @@ import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext;
import net.shibboleth.idp.plugin.authn.webauthn.storage.StorageServiceCredentialRepository;
import net.shibboleth.idp.profile.AbstractProfileAction;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java
index e1ba200..f8f9b1d 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java
@@ -32,10 +32,9 @@ import com.yubico.webauthn.data.PublicKeyCredentialRequestOptions;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnAuthenticationAction;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClient;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClientException;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.WebAuthnAuthenticationClientException;
import net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRegistration;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractAuthenticatorAssertionFromFormRequest.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractAuthenticatorAssertionFromFormRequest.java
index ffa2529..a3e7f10 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractAuthenticatorAssertionFromFormRequest.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ExtractAuthenticatorAssertionFromFormRequest.java
@@ -34,7 +34,6 @@ import com.yubico.webauthn.data.PublicKeyCredential;
import jakarta.servlet.http.HttpServletRequest;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnAuthenticationAction;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
index 1bf358c..796486d 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
@@ -27,7 +27,6 @@ import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnBaseAction;
import net.shibboleth.idp.plugin.authn.webauthn.context.BaseWebAuthnContext;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
index 926dc72..b2c2476 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
@@ -23,7 +23,6 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import net.shibboleth.idp.authn.AuthnEventIds;
-import net.shibboleth.idp.plugin.authn.webauthn.AbstractWebAuthnBaseAction;
import net.shibboleth.idp.plugin.authn.webauthn.context.BaseWebAuthnContext;
import net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRegistration;
import net.shibboleth.shared.primitive.LoggerFactory;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
index d1c5061..5410859 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
@@ -20,9 +20,9 @@ import net.shibboleth.idp.authn.AbstractValidationAction;
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.principal.UsernamePrincipal;
-import net.shibboleth.idp.plugin.authn.webauthn.AssertionFailureException;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClient;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.AssertionFailureException;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
import net.shibboleth.shared.component.ComponentInitializationException;
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialPublicKeyHolder.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialPublicKeyHolder.java
deleted file mode 100644
index 91ecf95..0000000
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/storage/impl/CredentialPublicKeyHolder.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.plugin.authn.webauthn.storage.impl;
-
-import java.time.Instant;
-
-import javax.annotation.Nonnull;
-
-import net.shibboleth.idp.plugin.authn.webauthn.CredentialPublicKey;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.logic.Constraint;
-
-/**
- * A holder for the {@link CredentialPublicKey} which includes additional information required for storage of the
- * public key information.
- */
-public class CredentialPublicKeyHolder {
-
- /**
- * The credential public key component of the credential key pair created by an authenticator during
- * registration.
- */
- @Nonnull private final CredentialPublicKey credentialPublicKey;
-
- @Nonnull private final Instant registrationTime;
-
- @Nonnull private final String username;
-
- /** The user ID as specified by the IdP that maps a credential public key to a user. */
- @Nonnull private final byte[] userHandle;
-
- //SortedSet<AuthenticatorTransport> transports;
-
- //Optional<Object> attestationMetadata;
-
-
- /**
- * Constructor.
- *
- * @param publicKey the credential public key
- */
- public CredentialPublicKeyHolder(@Nonnull final CredentialPublicKey publicKey,
- @Nonnull final Instant regTime, @Nonnull @NotEmpty final String uname,
- @Nonnull final byte[] id) {
- credentialPublicKey = Constraint.isNotNull(publicKey, "Credential public key can not be null");
- registrationTime = Constraint.isNotNull(regTime, "Registration time can not be null");
- username = Constraint.isNotEmpty(uname, "Username can not be null or empty");
- userHandle = Constraint.isNotEmpty(id, "UserHandle (ID) can not be null or empty");
- }
-
- /**
- * Get the credential public key.
- *
- * @return Returns the credentialPublicKey.
- */
- public CredentialPublicKey getCredentialPublicKey() {
- return credentialPublicKey;
- }
-
- @Nonnull public String getRegistrationTimestamp() {
- return registrationTime.toString();
- }
-
- @Nonnull public byte[] getId() {
- return userHandle;
- }
-
- @Nonnull public String getUsername() {
- return username;
- }
-
- @Nonnull public CredentialPublicKey getCredential() {
- return credentialPublicKey;
- }
-
-// public SortedSet<AuthenticatorTransport> getTransports() {
-// return transports;
-// }
-}
diff --git a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml
index b85d4b3..e35265c 100644
--- a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml
+++ b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml
@@ -83,6 +83,6 @@
<end-state id="RegistrationComplete"/>
<bean-import resource="webauthn-registration-beans.xml" />
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/authn/webauthn/webauthn-abstract-beans.xml" />
+ <bean-import resource="../../authn/WebAuthn/webauthn-abstract-beans.xml" />
</flow>
diff --git a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-flow.xml b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-flow.xml
index a4837d2..c4b66e2 100644
--- a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-flow.xml
+++ b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-flow.xml
@@ -59,6 +59,6 @@
</action-state>
<bean-import resource="webauthn-beans.xml" />
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/authn/webauthn/webauthn-abstract-beans.xml" />
+ <bean-import resource="webauthn-abstract-beans.xml" />
</flow>
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties
index 6e0a26d..b5476f2 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn.properties
@@ -1,3 +1,6 @@
-idp.authn.webauthn.relyingPartyId = localhost:8443
-idp.authn.webauthn.allowOriginPort = false
+## Thre relying party ID. Must be a valid domain string.
+## A public key credential is only registered and valid for a single relying party ID.
+idp.authn.webauthn.relyingPartyId = localhost
+## Allow any port on that origin
+idp.authn.webauthn.allowOriginPort = true
idp.authn.webauthn.allowOriginSubdomain = false
\ No newline at end of file
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/js/webauthn.js b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/js/webauthn.js
deleted file mode 100644
index 2cf5335..0000000
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/js/webauthn.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright (c) 2018, Yubico AB
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-(function(root, factory) {
- if (typeof define === 'function' && define.amd) {
- define(['base64url'], factory);
- } else if (typeof module === 'object' && module.exports) {
- module.exports = factory(require('base64url'));
- } else {
- root.webauthn = factory(root.base64url);
- }
-})(this, function(base64url) {
-
- function extend(obj, more) {
- return Object.assign({}, obj, more);
- }
-
- /**
- * Create a WebAuthn credential.
- *
- * @param request: object - A PublicKeyCredentialCreationOptions object, except
- * where binary values are base64url encoded strings instead of byte arrays
- *
- * @return a PublicKeyCredentialCreationOptions suitable for passing as the
- * `publicKey` parameter to `navigator.credentials.create()`
- */
- function decodePublicKeyCredentialCreationOptions(request) {
- const excludeCredentials = request.excludeCredentials.map(credential => extend(
- credential, {
- id: base64url.toByteArray(credential.id),
- }));
-
- const publicKeyCredentialCreationOptions = extend(
- request, {
- attestation: 'direct',
- user: extend(
- request.user, {
- id: base64url.toByteArray(request.user.id),
- }),
- challenge: base64url.toByteArray(request.challenge),
- excludeCredentials,
- });
-
- return publicKeyCredentialCreationOptions;
- }
-
- /**
- * Create a WebAuthn credential.
- *
- * @param request: object - A PublicKeyCredentialCreationOptions object, except
- * where binary values are base64url encoded strings instead of byte arrays
- *
- * @return the Promise returned by `navigator.credentials.create`
- */
- function createCredential(request) {
- return navigator.credentials.create({
- publicKey: decodePublicKeyCredentialCreationOptions(request),
- });
- }
-
- /**
- * Perform a WebAuthn assertion.
- *
- * @param request: object - A PublicKeyCredentialRequestOptions object,
- * except where binary values are base64url encoded strings instead of byte
- * arrays
- *
- * @return a PublicKeyCredentialRequestOptions suitable for passing as the
- * `publicKey` parameter to `navigator.credentials.get()`
- */
- function decodePublicKeyCredentialRequestOptions(request) {
- const allowCredentials = request.allowCredentials && request.allowCredentials.map(credential => extend(
- credential, {
- id: base64url.toByteArray(credential.id),
- }));
-
- const publicKeyCredentialRequestOptions = extend(
- request, {
- allowCredentials,
- challenge: base64url.toByteArray(request.challenge),
- });
-
- return publicKeyCredentialRequestOptions;
- }
-
- /**
- * Perform a WebAuthn assertion.
- *
- * @param request: object - A PublicKeyCredentialRequestOptions object,
- * except where binary values are base64url encoded strings instead of byte
- * arrays
- *
- * @return the Promise returned by `navigator.credentials.get`
- */
- function getAssertion(request) {
- console.log('Get assertion', request);
- return navigator.credentials.get({
- publicKey: decodePublicKeyCredentialRequestOptions(request),
- });
- }
-
-
- /** Turn a PublicKeyCredential object into a plain object with base64url encoded binary values */
- function responseToObject(response) {
- if (response.u2fResponse) {
- return response;
- } else {
- let clientExtensionResults = {};
-
- try {
- clientExtensionResults = response.getClientExtensionResults();
- } catch (e) {
- console.error('getClientExtensionResults failed', e);
- }
-
- if (response.response.attestationObject) {
- return {
- type: response.type,
- id: response.id,
- response: {
- attestationObject: bytesToBase64(response.response.attestationObject),
- clientDataJSON: bytesToBase64(response.response.clientDataJSON),
- },
- clientExtensionResults,
- };
- } else {
- return {
- type: response.type,
- id: response.id,
- response: {
- authenticatorData: base64url.fromByteArray(response.response.authenticatorData),
- clientDataJSON: base64url.fromByteArray(response.response.clientDataJSON),
- signature: base64url.fromByteArray(response.response.signature),
- userHandle: response.response.userHandle && base64url.fromByteArray(response.response.userHandle),
- },
- clientExtensionResults,
- };
- }
- }
- }
-
- return {
- decodePublicKeyCredentialCreationOptions,
- decodePublicKeyCredentialRequestOptions,
- createCredential,
- getAssertion,
- responseToObject,
- };
-
-});
\ No newline at end of file
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/module.properties b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/module.properties
index 0b8a9b8..a8eb51c 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/module.properties
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/module.properties
@@ -17,3 +17,30 @@ idp.authn.WebAuthn.1.replace = false
idp.authn.WebAuthn.2.src = /net/shibboleth/idp/plugin/authn/webauthn/conf/authn/webauthn-config.xml
idp.authn.WebAuthn.2.dest = conf/authn/webauthn-config.xml
idp.authn.WebAuthn.2.replace = false
+
+idp.authn.WebAuthn.3.src = /net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
+idp.authn.WebAuthn.3.dest = views//webauthn/webauthn-authn.vm
+
+idp.authn.WebAuthn.4.src = /net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
+idp.authn.WebAuthn.4.dest = views//webauthn/webauthn-register.vm
+
+idp.authn.WebAuthn.5.src = /net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
+idp.authn.WebAuthn.5.dest = views/webauthn/webauthn-registered.vm
+
+idp.authn.WebAuthn.6.src = /net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-selector.vm
+idp.authn.WebAuthn.6.dest = views//webauthn/webauthn-selector.vm
+
+idp.authn.WebAuthn.7.src = /net/shibboleth/idp/plugin/authn/webauthn/css/webauthn.css
+idp.authn.WebAuthn.7.dest = edit-webapp/css/webauthn.css
+idp.authn.WebAuthn.7.postenable = Customize edit-webapp/css/webauthn.css and rebuild war to deploy.
+
+idp.authn.WebAuthn.8.src = /net/shibboleth/idp/plugin/authn/webauthn/js/webauthn-json.js
+idp.authn.WebAuthn.8.dest = edit-webapp/js/webauthn-json.js
+
+idp.authn.WebAuthn.9.src = /net/shibboleth/idp/plugin/authn/webauthn/js/webauthn-support.js
+idp.authn.WebAuthn.9.dest = edit-webapp/js/webauthn-support.js
+
+idp.authn.WebAuthn.9.src = /net/shibboleth/idp/plugin/authn/webauthn/js/webauthn-json.js.map
+idp.authn.WebAuthn.9.dest = edit-webapp/js/webauthn-json.js.map
+
+
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
index 3b6b4e2..cc1ade8 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
@@ -40,7 +40,7 @@
.then(function (assertion){
document.getElementById("publicKeyAssertion").value = JSON.stringify(assertion);
document.getElementById("authenticationSubmit").click();
- }).catch(function (err){console.error});
+ }).catch(function (err){console.error(err)});
}
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
index c17545c..594c6ef 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
@@ -43,7 +43,7 @@
document.getElementById("authenticatorAttestation").value = JSON.stringify(attestation);
document.getElementById("registrationSubmit").click();
}).catch(function (err){
- console.error
+ console.error(err);
});
};
@@ -81,7 +81,7 @@
#if ($webauthnRegContext.existingCredentials)
<table>
<tr>
- <th>Nickname</th>
+ <th>Key Name</th>
<th>Transports</th>
<th>Registration Time</th>
<th>Delete</th>
@@ -91,7 +91,7 @@
<td>$cred.nickname</td>
<td>$cred.transports</td>
<td>$cred.registrationTimestamp</td>
- <td>Remove</td>
+ <td><button class="webauthn-table-button" id="removeButton">Remove</button></td>
</tr>
#end
</table>
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
index 33ad029..8a3633a 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
@@ -54,7 +54,7 @@
#if ($webauthnRegContext.existingCredentials)
<table>
<tr>
- <th>Nickname</th>
+ <th>Key Name</th>
<th>Transports</th>
<th>Registration Time</th>
</tr>
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java
index a12e6ea..b87a1df 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/client/impl/YubicoWebauthnAuthenticationClientTest.java
@@ -46,8 +46,8 @@ import com.yubico.webauthn.data.RelyingPartyIdentity;
import com.yubico.webauthn.data.UserIdentity;
import com.yubico.webauthn.data.UserVerificationRequirement;
-import net.shibboleth.idp.plugin.authn.webauthn.AssertionFailureException;
-import net.shibboleth.idp.plugin.authn.webauthn.RegistrationFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.AssertionFailureException;
+import net.shibboleth.idp.plugin.authn.webauthn.exception.RegistrationFailureException;
import net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnTest;
import net.shibboleth.idp.plugin.authn.webauthn.impl.MockAuthenticator;
import net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRegistration;
@@ -60,7 +60,7 @@ import net.shibboleth.shared.primitive.LoggerFactory;
* Tests for {@link YubicoWebauthnAuthenticationClient}. To some extend this is testing the Yubico libraries work
* correctly. But it does ensure the client has been constructed to use those libraries correctly.
*/
-public class YubicoWebauthnAuthenticationClientTest extends AbstractWebAuthnTest{
+public class YubicoWebauthnAuthenticationClientTest extends AbstractWebAuthnTest {
private final static String ORIGIN = "https://idp.example.com";
diff --git a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidatePublicKeyCredentialTest.java b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidatePublicKeyCredentialTest.java
index 8715c85..ac07f23 100644
--- a/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidatePublicKeyCredentialTest.java
+++ b/webauthn-impl/src/test/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidatePublicKeyCredentialTest.java
@@ -25,8 +25,8 @@ import com.yubico.webauthn.data.PublicKeyCredentialCreationOptions;
import com.yubico.webauthn.data.RelyingPartyIdentity;
import com.yubico.webauthn.data.UserIdentity;
-import net.shibboleth.idp.plugin.authn.webauthn.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.admin.impl.ValidateAuthenticatorAttestationResponse;
+import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.client.impl.YubicoWebauthnAuthenticationClient;
import net.shibboleth.idp.plugin.authn.webauthn.storage.impl.InMemoryRegistrationStorage;
import net.shibboleth.shared.codec.Base64Support;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list