Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/line/line-fido2-server
FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples.
https://github.com/line/line-fido2-server
example fido2 java passwordless relying-party security spring-boot webauthn
Last synced: about 1 month ago
JSON representation
FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples.
- Host: GitHub
- URL: https://github.com/line/line-fido2-server
- Owner: line
- License: apache-2.0
- Created: 2021-07-22T00:44:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T02:35:52.000Z (about 1 month ago)
- Last Synced: 2024-11-01T03:18:03.041Z (about 1 month ago)
- Topics: example, fido2, java, passwordless, relying-party, security, spring-boot, webauthn
- Language: Java
- Homepage:
- Size: 14.4 MB
- Stars: 525
- Watchers: 18
- Forks: 98
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-webauthn - LINE: FIDO2 Server - FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples. (Server Libraries)
- awesome-fido2 - line/line-fido2-server
README
# LINE FIDO2 SERVER
![Stars](https://img.shields.io/github/stars/line/line-fido2-server.svg?style=social)
![Repo Size](https://img.shields.io/github/repo-size/line/line-fido2-server)
![License Apache-2.0](https://img.shields.io/github/license/line/line-fido2-server)
![Top Language](https://img.shields.io/github/languages/top/line/line-fido2-server)
![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.7.12-green)
![Java version](https://img.shields.io/badge/Java-11-green)
![Data base](https://img.shields.io/badge/Storage-MySQL%2FH2%2FRedis-blue)
![Last Commit](https://img.shields.io/github/last-commit/line/line-fido2-server)> **FIDO2(WebAuthn) Server officially certified by FIDO Alliance**
## Overview
FIDO (Fast IDentity Online) is an open standard for online authentication, aiming to eliminate the vulnerabilities of
passwords. FIDO uses public-key cryptography instead of symmetric credentials like passwords or PINs.In essence, the user's device generates a key pair, storing the private key securely and sharing the public key with the
server. During both registration and authentication, the server challenges the device, and the device responds with a
digital signature using the private key. The server then verifies this signature with the stored public key. This
challenge-response protocol helps prevent replay attacks.### What is FIDO2?
FIDO2 is an enhancement of the FIDO standard for web and other platforms, supported by major web browsers and operating
systems. It encompasses two primary operations: Registration and Authentication.#### Registration
- The user selects a FIDO authenticator that meets the service’s acceptance policy.
- The user unlocks the authenticator via fingerprint, PIN, or another method.
- A public/private key pair is generated; the public key is sent to the service and associated with the user’s account,
while the private key remains on the device.
- The service challenges the device, which then creates a response using the private key to finish the registration
process.#### Authentication
- The service challenges the user to log in with a previously registered device.
- The user unlocks the authenticator using the same method as during registration.
- The device signs the service’s challenge and sends it back to the service.
- The service verifies the signature with the stored public key and grants access.### Challenge-Response Protocol
Both the registration and authentication processes utilize a challenge-response protocol to prevent replay attacks.
During registration, a challenge is sent from the server to the device and the device responds using its private key.
Similarly, during authentication, another challenge is sent to verify the user's identity. This ensures that each
attempt is unique and secure.## Screenshots
### Chrome on Mac with Touch ID
## Modules
- **rp-server**:
- RP Server Demo
- Depends on **common**
- **common**:
- Message classes that are commonly referenced by both the FIDO2 Server and the RP Server
- **core**:
- Contains the core domain logic of FIDO
- If the FIDO2 server being implemented does not interact with an RDB, this module alone should be used
- Depends on **common**
- **base**:
- Contains classes that depend on Spring JPA
- Service Implement classes, Repository interfaces, Entity classes
- Depends on **core**
- **demo**:
- FIDO2 server demo application
- Depends on **base**## Features
- Supported attestation types:
- Basic
- Self
- Attestation CA (Privacy CA)
- None
- Anonymization CA
- Supported attestation formats:
- Packed
- TPM
- Android Key Attestation
- Android SafetyNet
- FIDO U2F
- Apple Anonymous
- None
- Metadata service integration:
- FIDO MDSv3## How to Run
### Manual Run
Start the RP Server and FIDO2 Server:
```bash
# Start RP Server
cd rpserver
./gradlew bootRun# Start FIDO2 Server
cd fido2-demo/demo
./gradlew bootRun
```### Docker for demo
If you have Docker configured, you can use docker-compose.
```bash
# Start both RP Server and FIDO2 Server
docker-compose up
```Once the applications are running, access the test page at:
- http://localhost:8080/
### Local DB
The FIDO2 Server uses H2 as an embedded DB in a local environment, which should be replaced with a standalone DB (like
MySQL) for staging, beta, or production environments. Access the H2 web console at:- http://localhost:8081/h2-console
### Issues
- If data.sql doesn't work well in an IntelliJ environment,
try commenting on this part in build.gradle.```groovy
jar {
processResources {
exclude("**/*.sql")
}
}
```## API Guides
### Spring REST Docs
To view the API documentation, follow these steps:
1. Execute the following commands:
```bash
cd fido2-demo/demo
./gradlew makeRestDocs
./gradlew bootRun
```
2. Access the API documentation at the following path:- server: http://localhost:8081/docs/api-guide.html
### Swagger UI
After running the applications, you can view API guide documents at the link below.
- rpserver: http://localhost:8080/swagger-ui.html
- server: http://localhost:8081/swagger-ui.html## LINE WebAuthn Android and iOS
We are also providing Client SDK for Android/iOS applications. Please see below.
- [Introducing Fido2 Client SDK open source](https://techblog.lycorp.co.jp/ko/introducing-fido2-client-sdk-open-source)
- [LINE Webauthn Demo Kotlin](https://github.com/line/webauthndemo-kotlin)
- [LINE Webauthn Demo Swift](https://github.com/line/webauthndemo-swift)### checkOrigin Configuration
The `checkOrigin` method validates the origin of requests from LINE's Android and iOS applications. It ensures security
by checking that the request's origin matches a pre-configured list of allowed origins.How to Configure
To use the `checkOrigin` method, set up the allowed origins in the `application.yml` file. Here is an example
configuration:```yaml
app:
origins:
- android:aaa-bbb
- ios:aaa-bbb
```**Note:** Replace `aaa-bbb` with the appropriate values for your application.
**Important:** This configuration is optional and only necessary when integrating with LINE WebAuthn for Android and iOS
applications.## References
`LY Engineering Blogs`
- [FIDO at LINE: A First Step to a World Without Passwords](https://engineering.linecorp.com/en/blog/fido-at-line/)
- [FIDO at LINE: FIDO2 server as an open-source project](https://engineering.linecorp.com/en/blog/fido-at-line-fido2-server-opensource/)
- [Introducing Fido2 Client SDK open source](https://techblog.lycorp.co.jp/ko/introducing-fido2-client-sdk-open-source)`LY Tech Videos`
- [Open source contribution Starting with LINE FIDO2 Server](https://youtu.be/xKzXi5ic4Do)
- [Strong customer authentication & biometrics using FIDO](https://youtu.be/S1y9wFh7_dc)
- [Cross Platform Mobile Security At LINE](https://youtu.be/4288h-EamTU)
- [Secure LINE login with biometric key replacing password](https://youtu.be/vCAu-y-iwyw)`Internal`
- [Sequence Diagram](https://github.com/line/line-fido2-server/wiki/Sequence-diagrams)