All Projects → keys-pub → go-libfido2

keys-pub / go-libfido2

Licence: other
libfido2 bindings for golang

Programming Languages

c
50402 projects - #5 most used programming language
go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-libfido2

adfsmfa
MFA for ADFS 2022/2019/2016/2012r2
Stars: ✭ 86 (+104.76%)
Mutual labels:  webauthn, fido2
android-webauthn-authenticator
A WebAuthn Authenticator for Android leveraging hardware-backed key storage and biometric user verification.
Stars: ✭ 101 (+140.48%)
Mutual labels:  webauthn, fido2
awesome-yubikey
Curated list of awesome Yubikey resources, open source projects, tools and tutorials.
Stars: ✭ 22 (-47.62%)
Mutual labels:  webauthn, fido2
clarion
WebAuthn (U2F) helper for CLI operations (e.g. SSH Log in)
Stars: ✭ 78 (+85.71%)
Mutual labels:  webauthn, fido2
keycloak-radius-plugin
Make the radius server as part of keycloak SSO
Stars: ✭ 102 (+142.86%)
Mutual labels:  webauthn, fido2
wp-webauthn
🔒 WP-WebAuthn allows you to safely login to your WordPress site without password.
Stars: ✭ 85 (+102.38%)
Mutual labels:  webauthn, fido2
uru-card
Arduino based firmware for FIDO2 Authenticator
Stars: ✭ 114 (+171.43%)
Mutual labels:  webauthn, fido2
webauthn-example
Basic WebAuthn client and server in go
Stars: ✭ 53 (+26.19%)
Mutual labels:  webauthn, fido2
Solo
Solo 1: open security key supporting FIDO2 & U2F over USB + NFC
Stars: ✭ 1,986 (+4628.57%)
Mutual labels:  webauthn, fido2
webauthn-demo
WebAuthn demo with Ionic/Angular and Spring Boot
Stars: ✭ 22 (-47.62%)
Mutual labels:  webauthn, fido2
line-fido2-server
FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples.
Stars: ✭ 350 (+733.33%)
Mutual labels:  webauthn, fido2
Opensk
OpenSK is an open-source implementation for security keys written in Rust that supports both FIDO U2F and FIDO2 standards.
Stars: ✭ 2,114 (+4933.33%)
Mutual labels:  webauthn, fido2
FIDO-Server
Open-source FIDO server, featuring the FIDO2 standard.
Stars: ✭ 17 (-59.52%)
Mutual labels:  webauthn, fido2
khefin
A simple way to generate password-proteceted secrets from a FIDO2 authenticator with the hmac-secret extension
Stars: ✭ 47 (+11.9%)
Mutual labels:  fido2-authenticator
caddy-security
🔐 Authentication, Authorization, and Accounting (AAA) App and Plugin for Caddy v2. 💎 Implements Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA/2FA with App Authenticators and Yubico. 💎 Authorization with JWT/PASETO tokens. 🔐
Stars: ✭ 696 (+1557.14%)
Mutual labels:  webauthn
hms-FIDO-demo-java
HMS FIDO demo, including fido2 demo, bioauthn demo and bioauthn-androidx demo.
Stars: ✭ 17 (-59.52%)
Mutual labels:  fido2
devicecheck-appattest
Server-side library to validate the authenticity of Apple App Attest artifacts, written in Kotlin.
Stars: ✭ 45 (+7.14%)
Mutual labels:  webauthn
SimpleWebAuthn
WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers and Node.
Stars: ✭ 206 (+390.48%)
Mutual labels:  webauthn
kagi
WebAuthn security keys and TOTP multi-factor authentication for Django
Stars: ✭ 17 (-59.52%)
Mutual labels:  webauthn
webauthn.me
webauthn.me, learn more about the Web Authentication API or try the debugger.
Stars: ✭ 30 (-28.57%)
Mutual labels:  webauthn

go-libfido2

Go wrapper for libfido2.

import (
    "github.com/keys-pub/go-libfido2"
)

func ExampleDevice_Assertion() {
    locs, err := libfido2.DeviceLocations()
    if err != nil {
        log.Fatal(err)
    }
    if len(locs) == 0 {
        log.Println("No devices")
        return
    }

    log.Printf("Using device: %+v\n", locs[0])
    path := locs[0].Path
    device, err := libfido2.NewDevice(path)
    if err != nil {
        log.Fatal(err)
    }

    cdh := libfido2.RandBytes(32)
    userID := libfido2.RandBytes(32)
    salt := libfido2.RandBytes(32)
    pin := "12345"

    attest, err := device.MakeCredential(
        cdh,
        libfido2.RelyingParty{
            ID: "keys.pub",
        },
        libfido2.User{
            ID:   userID,
            Name: "gabriel",
        },
        libfido2.ES256, // Algorithm
        pin,
        &libfido2.MakeCredentialOpts{
            Extensions: []libfido2.Extension{libfido2.HMACSecretExtension},
        },
    )
    if err != nil {
        log.Fatal(err)
    }

    log.Printf("Attestation:\n")
    log.Printf("AuthData: %s\n", hex.EncodeToString(attest.AuthData))
    log.Printf("ClientDataHash: %s\n", hex.EncodeToString(attest.ClientDataHash))
    log.Printf("ID: %s\n", hex.EncodeToString(attest.CredentialID))
    log.Printf("Type: %s\n", attest.CredentialType)
    log.Printf("Sig: %s\n", hex.EncodeToString(attest.Sig))

    assertion, err := device.Assertion(
        "keys.pub",
        cdh,
        [][]byte{attest.CredentialID},
        pin,
        &libfido2.AssertionOpts{
            Extensions: []libfido2.Extension{libfido2.HMACSecretExtension},
            HMACSalt:   salt,
        },
    )
    if err != nil {
        log.Fatal(err)
    }

    log.Printf("Assertion:\n")
    log.Printf("%s\n", hex.EncodeToString(assertion.AuthData))
    log.Printf("%s\n", hex.EncodeToString(assertion.HMACSecret))
    log.Printf("%s\n", hex.EncodeToString(assertion.Sig))

    // Output:
    //
}

Examples

The examples require a device.

To run an example, set FIDO2_EXAMPLES=1.

FIDO2_EXAMPLES=1 go test -v -run ExampleDeviceLocations
FIDO2_EXAMPLES=1 go test -v -run ExampleDevice_Assertion
FIDO2_EXAMPLES=1 go test -v -run ExampleDevice_Credentials

Dependencies

Linux

sudo apt install software-properties-common
sudo apt-add-repository ppa:yubico/stable
sudo apt update
sudo apt install libfido2-dev

macOS

brew install keys-pub/tap/libfido2

Windows

scoop bucket add keys.pub https://github.com/keys-pub/scoop-bucket
scoop install libfido2

Building libfido2

macOS

export CFLAGS="-I/usr/local/include -I/usr/local/opt/[email protected]/include"
export LDFLAGS="-L/usr/local/lib -L/usr/local/opt/[email protected]/lib/"
(rm -rf build && mkdir build && cd build && cmake ..) && make -C build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].