Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

internet-identity-labs/nfid-auth-client-demo

 
 

Repository files navigation

Auth-Client Demo

This is an example project, intended to demonstrate how an app developer might integrate with an Internet Identity.

For a non-typescript implementation, see https://github.com/krpeacock/auth-client-demo/tree/vanilla-js

Live demo

This is an example showing how to use @dfinity/auth-client.

To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.

To learn more before you start working with auth_demo, see the following documentation available online:

Setting up for local development

To get started, start a local dfx development environment in this directory with the following steps:

cd auth-client-demo/
dfx start --background --clean
dfx deploy

Then, make sure you have the Internet Identity repo cloned locally, adjacent to this project.

cd ../internet-identity
rm -rf .dfx/local
II_FETCH_ROOT_KEY=1 II_DUMMY_CAPTCHA=1  dfx deploy --no-wallet --argument '(null)'
pushd

Copy the canister ID fom the Internet Identity canister, and paste it into webpack.config.js in this project on the LOCAL_II_CANISTER variable on line 8.

Finally, cd back into the auth-client-demo directory and start the development server with npm start.

You can now access the app at http://localhost:8080.

About

Example demo of how to use https://www.npmjs.com/package/@dfinity/auth-client to make authenticated calls to an IC app with NFID

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.4%
  • CSS 15.9%
  • TypeScript 13.1%
  • HTML 1.2%
  • Motoko 0.4%