Skip to content

Commit f2fe958

Browse files
committed
Added WebAuthn4J module
Almost the same API as the WebAuthn module, but backed by WebAuthn4J
1 parent 70abe97 commit f2fe958

36 files changed

+4871
-5
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<module>vertx-auth-htdigest</module>
3737
<module>vertx-auth-htpasswd</module>
3838
<module>vertx-auth-webauthn</module>
39+
<module>vertx-auth-webauthn4j</module>
3940
<module>vertx-auth-properties</module>
4041
<module>vertx-auth-sql-client</module>
4142
<module>vertx-auth-otp</module>

vertx-auth-common/src/main/java/module-info.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
io.vertx.ext.auth.impl.hash.SHA512,
3535
io.vertx.ext.auth.impl.hash.PBKDF2;
3636

37-
exports io.vertx.ext.auth.impl to io.vertx.auth.htdigest, io.vertx.auth.htpasswd, io.vertx.auth.oauth2, io.vertx.auth.otp, io.vertx.auth.sqlclient, io.vertx.auth.webauthn;
38-
exports io.vertx.ext.auth.impl.jose to io.vertx.auth.jwt, io.vertx.auth.oauth2, io.vertx.auth.webauthn, io.vertx.tests;
39-
exports io.vertx.ext.auth.impl.cose to io.vertx.auth.webauthn, io.vertx.tests;
40-
exports io.vertx.ext.auth.impl.asn to io.vertx.auth.webauthn;
37+
exports io.vertx.ext.auth.impl to io.vertx.auth.htdigest, io.vertx.auth.htpasswd, io.vertx.auth.oauth2, io.vertx.auth.otp, io.vertx.auth.sqlclient, io.vertx.auth.webauthn, io.vertx.auth.webauthn4j;
38+
exports io.vertx.ext.auth.impl.jose to io.vertx.auth.jwt, io.vertx.auth.oauth2, io.vertx.auth.webauthn, io.vertx.auth.webauthn4j, io.vertx.tests;
39+
exports io.vertx.ext.auth.impl.cose to io.vertx.auth.webauthn, io.vertx.auth.webauthn4j, io.vertx.tests;
40+
exports io.vertx.ext.auth.impl.asn to io.vertx.auth.webauthn, io.vertx.auth.webauthn4j;
4141
exports io.vertx.ext.auth.authorization.impl to io.vertx.auth.abac;
42-
exports io.vertx.ext.auth.impl.http to io.vertx.auth.oauth2, io.vertx.auth.webauthn;
42+
exports io.vertx.ext.auth.impl.http to io.vertx.auth.oauth2, io.vertx.auth.webauthn, io.vertx.auth.webauthn4j;
4343

4444
}

vertx-auth-webauthn4j/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vertx-auth-webauthn/
2+
/.apt_generated_tests/

vertx-auth-webauthn4j/README.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
= Vert.x WebAuthN4J Auth
2+
3+
This component contains a WebAuthn authentication mechanism using https://github.com/webauthn4j/webauthn4j[WebAuthn4J].
4+
To use this project, add the following dependency to the _dependencies_ section of your build descriptor:
5+
6+
FIDO2 is a "passwordless" authentication mechanism and the JavaScript API is more known as WebAuthN.
7+
8+
WebAuthN allows users to authenticate using a secure device or token and no passwords are exchange between the browser and the server (also known as Relay Party).
9+
10+
The current implementation supports both authentication and device attestation.
11+
12+
Device attestation is a verification of the device itself.
13+
Currently the following attestations are implemented:
14+
15+
* none
16+
* U2F (FIDO-U2F tokens, e.g.: Yubikey's)
17+
* Packed
18+
* Android Key
19+
* Android Safetynet
20+
* TPM
21+
* Apple
22+
23+

vertx-auth-webauthn4j/pom.xml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2014 Red Hat, Inc.
4+
~
5+
~ All rights reserved. This program and the accompanying materials
6+
~ are made available under the terms of the Eclipse Public License v1.0
7+
~ and Apache License v2.0 which accompanies this distribution.
8+
~
9+
~ The Eclipse Public License is available at
10+
~ http://www.eclipse.org/legal/epl-v10.html
11+
~
12+
~ The Apache License v2.0 is available at
13+
~ http://www.opensource.org/licenses/apache2.0.php
14+
~
15+
~ You may elect to redistribute this code under either of these licenses.
16+
-->
17+
18+
<project xmlns="https://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<parent>
22+
<artifactId>vertx-auth-parent</artifactId>
23+
<groupId>io.vertx</groupId>
24+
<version>5.0.0-SNAPSHOT</version>
25+
</parent>
26+
<modelVersion>4.0.0</modelVersion>
27+
28+
<artifactId>vertx-auth-webauthn4j</artifactId>
29+
30+
<properties>
31+
<doc.skip>false</doc.skip>
32+
<webauthn4j.version>0.27.0.RELEASE</webauthn4j.version>
33+
</properties>
34+
35+
36+
<dependencies>
37+
<dependency>
38+
<groupId>io.vertx</groupId>
39+
<artifactId>vertx-auth-common</artifactId>
40+
</dependency>
41+
<dependency>
42+
<groupId>com.webauthn4j</groupId>
43+
<artifactId>webauthn4j-core-async</artifactId>
44+
<version>${webauthn4j.version}</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>com.webauthn4j</groupId>
48+
<artifactId>webauthn4j-metadata-async</artifactId>
49+
<version>${webauthn4j.version}</version>
50+
</dependency>
51+
<dependency>
52+
<groupId>com.webauthn4j</groupId>
53+
<artifactId>webauthn4j-test</artifactId>
54+
<scope>test</scope>
55+
<version>${webauthn4j.version}</version>
56+
<exclusions>
57+
<!--Causes double module import by different paths otherwise-->
58+
<exclusion>
59+
<groupId>org.springframework</groupId>
60+
<artifactId>spring-jcl</artifactId>
61+
</exclusion>
62+
</exclusions>
63+
</dependency>
64+
<dependency>
65+
<groupId>io.vertx</groupId>
66+
<artifactId>vertx-unit</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
</dependencies>
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.codehaus.mojo</groupId>
75+
<artifactId>build-helper-maven-plugin</artifactId>
76+
<executions>
77+
<execution>
78+
<goals>
79+
<goal>attach-artifact</goal>
80+
</goals>
81+
<configuration>
82+
<artifacts>
83+
<artifact>
84+
<file>${basedir}/src/main/js/vertx-auth-webauthn4j.js</file>
85+
<classifier>client</classifier>
86+
<type>js</type>
87+
</artifact>
88+
</artifacts>
89+
</configuration>
90+
</execution>
91+
</executions>
92+
</plugin>
93+
</plugins>
94+
</build>
95+
96+
<profiles>
97+
<profile>
98+
<id>IT</id>
99+
<activation>
100+
<property>
101+
<name>env.CI</name>
102+
<value>true</value>
103+
</property>
104+
</activation>
105+
<build>
106+
<plugins>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-failsafe-plugin</artifactId>
110+
<version>3.0.0</version>
111+
<executions>
112+
<execution>
113+
<goals>
114+
<goal>integration-test</goal>
115+
<goal>verify</goal>
116+
</goals>
117+
<configuration>
118+
<useModulePath>false</useModulePath>
119+
</configuration>
120+
</execution>
121+
</executions>
122+
</plugin>
123+
</plugins>
124+
</build>
125+
</profile>
126+
</profiles>
127+
128+
</project>
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
= Enums
2+
3+
[[Attestation]]
4+
== Attestation
5+
6+
++++
7+
AttestationConveyancePreference
8+
https://www.w3.org/TR/webauthn/#attestation-convey
9+
++++
10+
'''
11+
12+
[cols=">25%,75%"]
13+
[frame="topbot"]
14+
|===
15+
^|Name | Description
16+
|
17+
[[NONE]]`NONE`|-
18+
|
19+
[[INDIRECT]]`INDIRECT`|-
20+
|
21+
[[DIRECT]]`DIRECT`|-
22+
|===
23+
24+
[[AuthenticatorAttachment]]
25+
== AuthenticatorAttachment
26+
27+
++++
28+
AuthenticatorAttachment
29+
https://www.w3.org/TR/webauthn/#enumdef-authenticatorattachment
30+
++++
31+
'''
32+
33+
[cols=">25%,75%"]
34+
[frame="topbot"]
35+
|===
36+
^|Name | Description
37+
|
38+
[[PLATFORM]]`PLATFORM`|-
39+
|
40+
[[CROSS_PLATFORM]]`CROSS_PLATFORM`|-
41+
|===
42+
43+
[[AuthenticatorTransport]]
44+
== AuthenticatorTransport
45+
46+
++++
47+
AuthenticatorTransport
48+
https://www.w3.org/TR/webauthn/#enumdef-authenticatortransport
49+
++++
50+
'''
51+
52+
[cols=">25%,75%"]
53+
[frame="topbot"]
54+
|===
55+
^|Name | Description
56+
|
57+
[[USB]]`USB`|-
58+
|
59+
[[NFC]]`NFC`|-
60+
|
61+
[[BLE]]`BLE`|-
62+
|
63+
[[INTERNAL]]`INTERNAL`|-
64+
|===
65+
66+
[[PublicKeyCredential]]
67+
== PublicKeyCredential
68+
69+
++++
70+
PublicKeyCredential
71+
https://www.iana.org/assignments/cose/cose.xhtml#algorithms
72+
++++
73+
'''
74+
75+
[cols=">25%,75%"]
76+
[frame="topbot"]
77+
|===
78+
^|Name | Description
79+
|
80+
[[ES256]]`ES256`|-
81+
|
82+
[[ES384]]`ES384`|-
83+
|
84+
[[ES512]]`ES512`|-
85+
|
86+
[[PS256]]`PS256`|-
87+
|
88+
[[PS384]]`PS384`|-
89+
|
90+
[[PS512]]`PS512`|-
91+
|
92+
[[ES256K]]`ES256K`|-
93+
|
94+
[[RS256]]`RS256`|-
95+
|
96+
[[RS384]]`RS384`|-
97+
|
98+
[[RS512]]`RS512`|-
99+
|
100+
[[RS1]]`RS1`|-
101+
|
102+
[[EdDSA]]`EdDSA`|-
103+
|===
104+
105+
[[UserVerification]]
106+
== UserVerification
107+
108+
++++
109+
UserVerificationRequirement
110+
https://www.w3.org/TR/webauthn/#enumdef-userverificationrequirement
111+
++++
112+
'''
113+
114+
[cols=">25%,75%"]
115+
[frame="topbot"]
116+
|===
117+
^|Name | Description
118+
|
119+
[[REQUIRED]]`REQUIRED`|-
120+
|
121+
[[PREFERRED]]`PREFERRED`|-
122+
|
123+
[[DISCOURAGED]]`DISCOURAGED`|-
124+
|===
125+

0 commit comments

Comments
 (0)