Skip to content

Commit 2f22baa

Browse files
committed
Version 0.1.0 of java-webauthn-server
- First release of [Web Authentication][webauthn] support - Merged U2F subprojects into webauthn-server-core and deleted lots of unused code [webauthn]: https://www.w3.org/TR/webauthn/
2 parents e8f2935 + df1f49f commit 2f22baa

File tree

241 files changed

+13537
-6084
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+13537
-6084
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
out/
99
*.iml
1010
*.iws
11+
*/out/
1112

1213
# Mac
1314
.DS_Store

NEWS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
== Version 0.1.0 ==
2+
3+
* First release of https://www.w3.org/TR/webauthn/[Web Authentication] support
4+
* Merged U2F subprojects into webauthn-server-core and deleted lots of unused code
5+
6+
7+
= java-u2flib-server version history =
8+
9+
This project was forked from https://developers.yubico.com/java-u2flib-server/[java-u2flib-server]. Below is the version history from before the fork.
10+
11+
112
== Version 0.19.0 ==
213

314
Breaking changes:

README

Lines changed: 15 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,23 @@
1-
== java-u2flib-server
1+
== java-webauthn-server
22

3-
image:https://travis-ci.org/Yubico/java-u2flib-server.svg?branch=master["Build Status", link="https://travis-ci.org/Yubico/java-u2flib-server"]
4-
image:https://coveralls.io/repos/github/Yubico/java-u2flib-server/badge.svg["Coverage Status", link="https://coveralls.io/github/Yubico/java-u2flib-server"]
3+
_Note: This is a work in progress. The https://www.w3.org/TR/webauthn/[Web
4+
Authentication standard] is not yet finished, and any part of this project may
5+
change at any time._
56

6-
Server-side https://developers.yubico.com/U2F[U2F] library for Java. Provides functionality for registering
7-
U2F devices and authenticating with said devices.
7+
image:https://travis-ci.org/Yubico/java-webauthn-server.svg?branch=master["Build Status", link="https://travis-ci.org/Yubico/java-webauthn-server"]
8+
image:https://coveralls.io/repos/github/Yubico/java-webauthn-server/badge.svg["Coverage Status", link="https://coveralls.io/github/Yubico/java-webauthn-server"]
89

9-
=== Dependency
10+
Server-side https://www.w3.org/TR/webauthn/[Web Authentication] library for
11+
Java. Provides implementations of the
12+
https://www.w3.org/TR/webauthn/#rp-operations[Relying Party operations] required
13+
for a server to support Web Authentication. This includes registering
14+
authenticators and authenticating registered authenticators.
1015

11-
Maven:
12-
[source, xml]
13-
<dependency>
14-
<groupId>com.yubico</groupId>
15-
<artifactId>u2flib-server-core</artifactId>
16-
<version>0.19.0</version>
17-
</dependency>
16+
The project is currently implemented mostly in Scala; this is intended to be
17+
translated to Java when the specification and these APIs seem stable enough.
1818

19-
Gradle:
20-
[source, groovy]
21-
repositories{ mavenCentral() }
22-
dependencies {
23-
compile 'com.yubico:u2flib-server-core:0.19.0'
24-
}
2519

2620
=== Example Usage
27-
NOTE: Make sure that you have read https://developers.yubico.com/U2F/Libraries/Using_a_library.html[Using a U2F library] before continuing.
2821

29-
[source, java]
30-
----
31-
32-
private abstract Iterable<DeviceRegistration> getRegistrations(String username);
33-
34-
@GET
35-
public View startAuthentication(String username) throws NoEligibleDevicesException {
36-
37-
// Generate a challenge for each U2F device that this user has registered
38-
SignRequestData requestData
39-
= u2f.startSignature(SERVER_ADDRESS, getRegistrations(username));
40-
41-
// Store the challenges for future reference
42-
requestStorage.put(requestData.getRequestId(), requestData.toJson());
43-
44-
// Return an HTML page containing the challenges
45-
return new AuthenticationView(requestData.toJson(), username);
46-
}
47-
48-
@POST
49-
public String finishAuthentication(SignResponse response, String username) throws
50-
DeviceCompromisedException {
51-
52-
// Get the challenges that we stored when starting the authentication
53-
SignRequestData signRequest
54-
= requestStorage.remove(response.getRequestId());
55-
56-
// Verify the that the given response is valid for one of the registered devices
57-
u2f.finishSignature(signRequest,
58-
response,
59-
getRegistrations(username));
60-
61-
return "Successfully authenticated!";
62-
}
63-
----
64-
65-
In the above example `getRegistrations()` will return the U2F devices currently associated with a given user.
66-
This is most likely stored in a database.
67-
See link:u2flib-server-demo[`u2flib-server-demo`] for a complete demo server (including registration and storage of U2F devices).
68-
69-
=== JavaDoc
70-
JavaDoc can be found at https://developers.yubico.com/java-u2flib-server[developers.yubico.com/java-u2flib-server].
71-
72-
73-
=== Attestation
74-
The attestation module (`u2flib-server-attestation`) enables you to restrict registrations to certain U2F devices (e.g. devices made by a specific vendor). It can also provide metadata for devices.
75-
76-
=== Serialization
77-
All relevant classes implement `Serializable`, so instead of using `toJson()`, you can use Java's built in serialization mechanism.
78-
Internally the classes use Jackson to serialize to and from JSON, and the ObjectMapper from Jackson can be used.
22+
See link:webauthn-server-demo[`webauthn-server-demo`] for a complete demo
23+
server, which stores authenticator registrations temporarily in memory.

build.gradle

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ plugins {
1212
id 'net.researchgate.release' version '2.4.0'
1313
}
1414

15-
import com.yubico.gradle.plugins.signing.GpgSigningPlugin
1615

1716
project.ext.publishEnabled = System.env.CI != 'true' && project.hasProperty('ossrhUsername')
1817

@@ -24,24 +23,26 @@ if (publishEnabled) {
2423
}
2524
}
2625

26+
task wrapper(type: Wrapper) {
27+
gradleVersion = '4.5.1'
28+
}
29+
2730
allprojects {
2831
apply plugin: 'java'
2932
apply plugin: 'maven'
33+
apply plugin: 'signing'
34+
apply plugin: 'idea'
3035

3136
if (publishEnabled) {
32-
apply plugin: GpgSigningPlugin
3337
signing {
38+
useGpgCmd()
3439
sign configurations.archives
3540
}
3641
signArchives.dependsOn check
3742
}
3843

39-
task wrapper(type: Wrapper) {
40-
gradleVersion = '4.1'
41-
}
42-
4344
group = 'com.yubico'
44-
version = '0.19.0'
45+
version = '0.1.0'
4546

4647
sourceCompatibility = 1.6
4748
targetCompatibility = 1.6
@@ -55,6 +56,9 @@ allprojects {
5556

5657
maven { url "http://repo.maven.apache.org/maven2" }
5758
}
59+
60+
61+
idea.module { downloadJavadoc = true }
5862
}
5963

6064
evaluationDependsOnChildren()
@@ -108,15 +112,10 @@ subprojects {
108112

109113
pom.project {
110114
name project.description
111-
description 'Java server-side library for U2F'
115+
description 'Java server-side library for Web Authentication'
112116
url 'https://developers.yubico.com/'
113117

114118
developers {
115-
developer {
116-
id 'dain'
117-
name 'Dain Nilsson'
118-
119-
}
120119
developer {
121120
id 'emil'
122121
name 'Emil Lundberg'
@@ -132,9 +131,9 @@ subprojects {
132131
}
133132

134133
scm {
135-
url 'scm:git:git://github.com/Yubico/java-u2flib-server.git'
136-
connection 'scm:git:git://github.com/Yubico/java-u2flib-server.git'
137-
developerConnection 'scm:git:ssh://[email protected]/Yubico/java-u2flib-server.git'
134+
url 'scm:git:git://github.com/Yubico/java-webauthn-server.git'
135+
connection 'scm:git:git://github.com/Yubico/java-webauthn-server.git'
136+
developerConnection 'scm:git:ssh://[email protected]/Yubico/java-webauthn-server.git'
138137
tag 'HEAD'
139138
}
140139
}
@@ -145,7 +144,7 @@ subprojects {
145144

146145
}
147146

148-
configure(subprojects.findAll { it.name != 'u2flib-server-demo' }) {
147+
subprojects {
149148
apply plugin: 'info.solidsoft.pitest'
150149

151150
pitest {

buildSrc/src/main/groovy/com/yubico/gradle/plugins/signing/GpgSigningPlugin.groovy

Lines changed: 0 additions & 17 deletions
This file was deleted.

buildSrc/src/main/groovy/com/yubico/gradle/plugins/signing/signatory/gpg/GpgSignatoryProvider.groovy

Lines changed: 0 additions & 24 deletions
This file was deleted.

buildSrc/src/main/java/com/yubico/gradle/plugins/signing/signatory/gpg/GpgSignatory.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

dev-util/example-authentication.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)