All Projects → NuID → examples

NuID / examples

Licence: other
Examples of NuID's zero knowledge authentication and key management facilities in various languages and frameworks. Open an Issue or PR if you'd like to see your favorite tool here.

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
java
68154 projects - #9 most used programming language
go
31211 projects - #10 most used programming language
objective c
16641 projects - #2 most used programming language
clojure
4091 projects

Projects that are alternatives of or similar to examples

zk
Cross-platform zero knowledge proofs
Stars: ✭ 44 (+4.76%)
Mutual labels:  key-management, zero-knowledge
shim
The Userify Shim (cloud agent)
Stars: ✭ 57 (+35.71%)
Mutual labels:  key-management
zkp
Experimental zero-knowledge proof compiler in Rust macros
Stars: ✭ 121 (+188.1%)
Mutual labels:  zero-knowledge
vulcan
A JavaScript propositional logic and resolution library
Stars: ✭ 56 (+33.33%)
Mutual labels:  proof
zkp-ecdsa
Proves knowledge of an ECDSA-P256 signature under one of many public keys that are stored in a list.
Stars: ✭ 118 (+180.95%)
Mutual labels:  zero-knowledge
ffxiv-collect
Another collection tracker for Final Fantasy XIV
Stars: ✭ 32 (-23.81%)
Mutual labels:  ruby-on-rails
graphql-rails logger
Display GraphQL queries in a more readable format
Stars: ✭ 102 (+142.86%)
Mutual labels:  ruby-on-rails
stimulus todomvc
[WIP] An implementation of TodoMVC using Ruby on Rails and StimulusJS
Stars: ✭ 14 (-66.67%)
Mutual labels:  ruby-on-rails
veue
Veue was a live video streaming service, and this is the code built over ~10 months by Hampton Catlin, Konnor Rogers, Sirbuland Atlas, and a handful of others.
Stars: ✭ 49 (+16.67%)
Mutual labels:  ruby-on-rails
halfstaff
🇺🇸 Is the US flag at half-staff?
Stars: ✭ 22 (-47.62%)
Mutual labels:  ruby-on-rails
matestack-docs
Documentation of matestack-ui-core built with matestack itself, consuming Github API for content
Stars: ✭ 14 (-66.67%)
Mutual labels:  ruby-on-rails
filtered
Filters ActiveRecord queries in a nice way
Stars: ✭ 28 (-33.33%)
Mutual labels:  ruby-on-rails
arask
Automatic RAils taSKs.
Stars: ✭ 31 (-26.19%)
Mutual labels:  ruby-on-rails
aliceandbob
🔐 A free, light and easy to use client-side tool to generate PGP key pairs, encrypt and decrypt messages.
Stars: ✭ 24 (-42.86%)
Mutual labels:  ruby-on-rails
universe
Decentralized private key recovery
Stars: ✭ 13 (-69.05%)
Mutual labels:  key-management
my-awesome-projects
Learn by doing projects
Stars: ✭ 48 (+14.29%)
Mutual labels:  ruby-on-rails
FlashPaper
One-time encrypted password/secret sharing
Stars: ✭ 85 (+102.38%)
Mutual labels:  zero-knowledge
rails hotwire base
Rails + Hotwire base app
Stars: ✭ 54 (+28.57%)
Mutual labels:  ruby-on-rails
LocalSupport
A directory of local support services and volunteer opportunities
Stars: ✭ 60 (+42.86%)
Mutual labels:  ruby-on-rails
shizoid
Shizoid chatter bot on Ruby
Stars: ✭ 37 (-11.9%)
Mutual labels:  ruby-on-rails

NuID :: Examples

This repository contains examples of interacting with various NuID libraries, packages, and APIs across various languages, libraries, and frameworks. The examples provided here are meant to suplement the official documentation found at NuID's Developer Portal.

Prerequisites

If you want to run some of these examples, you'll generally need the following:

Usage

# Fetch the code
$ git clone https://github.com/NuID/examples.git
$ cd examples

# All servers will need an API Key to talk to the API
$ export NUID_API_KEY="<your api key>"

# the start target will fetch all necessary dependencies
# use client=js-react and server=js-node defaults
$ make start

# optionally set the client or server examples to use
# see below for supported clients and servers
$ make start server=go

As we add new examples for other languages you'll be able to change server=<folder> or client=<folder> to whichever example you wish to run.

Supported examples

client=<lang>

  • js-react (default) - make start or make start client=js-react
  • js-react-native - make start client=js-react-native

server=<lang>

  • js-node (default) - make start or make start server=js-node
  • clojure-ring - make start server=clojure-ring
  • go - make start server=go
  • ruby-rails - make start server=ruby-rails

Documentation

Lots of the code in each example has been commented, but more documentation can be found on the portal. We're constantly updating the docs with guides, videos, and language reference.

Contact

Get in touch with any questions or feedback at [email protected]. We'd love to hear from you.


js-react + js-node example

Provided here is an example of a Node.js+React application that initially uses password hashing for authentication. Over the course of four tagged commits we'll show how to convert from password hashing to using NuID for credential management, all without changing your login+registration UX.

Note: This repo's directory structure has changed since the tagged commits linked below, just be aware you'll only see a client and server directory instead of js-react and js-node respectively (along with any other language examples that will be added later). Checking out the main branch at any time will get you back to the most recent examples available.

Overview of NuID

  • Trustless authentication using Zero-Knowledge proofs.
  • Slots seamlessly into existing password-based flows.
  • Eliminates password breach risks. Passwords don't leave your client devices and aren't stored on your server.
  • NuID Auth API provides ZK credential creation and retrieval.

Demo: Initial app uses hashed password authentication

  • Two core flows in authentication: registration and login.
  • Email+Password used for registering and authenticating users.
  • Email is the unique key for the user account.
  • Password is always sent to backend, hashed, and stored.
  • Browse Code

Demo: Integrate with NuID Auth API

  • Add @nuid/zk npm package to both client and server applications.
  • Get an API Key from the NuID Developer Portal.
  • Add API Key and URL to server process environment.
  • Create API Post and Get functions to talk to NuID Auth API.
  • Browse Code
  • See Diff

Demo: Convert registration to use NuID

  • Add nuid field to user table.
  • Client creates a verified credential with the password during registration.
  • Client submits to /register with the email and a verified credential.
  • The password is not sent to the server.
  • Server receives verified credential and registers for a new NuID.
  • Server stores the NuID along with the other user parameters.
  • Browse Code
  • See Diff

Demo: Convert login to use NuID

  • Add server endpoint /challenge to get a challenge for the authenticating user from NuID.
  • Client login process asks for a /challenge for the user with the given email.
  • Challenge JWT claims are decoded client-side and used to generate a ZK Proof with the password.
  • Client login submits to /login with the email, challenge JWT, and proof.
  • The password is not sent to the server.
  • Server /login verifies the challenge JWT and proof with NuID.
  • User is now authenticated.
  • Browse Code
  • See Diff
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].