Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corbado/example-passkeys-nodejs
Node.js (Express) repository of a sample app that offers passkey authentication.
https://github.com/corbado/example-passkeys-nodejs
authentication fido2 nodejs passkey passkeys passwordless webauthn
Last synced: 28 days ago
JSON representation
Node.js (Express) repository of a sample app that offers passkey authentication.
- Host: GitHub
- URL: https://github.com/corbado/example-passkeys-nodejs
- Owner: corbado
- Created: 2023-03-21T09:50:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T08:55:18.000Z (2 months ago)
- Last Synced: 2024-10-21T12:25:56.791Z (2 months ago)
- Topics: authentication, fido2, nodejs, passkey, passkeys, passwordless, webauthn
- Language: TypeScript
- Homepage: https://www.corbado.com/passkeys/node-js
- Size: 160 KB
- Stars: 9
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js (Express) Passkey Example App
This is a sample implementation of frontend and backend where the Corbado Node.js SDK and Web-js components are
integrated in an Express application.## 1. File structure
```
├── ...
├── .env # Environment variables for the application
├── src
│ ├── app.ts # Application Entrypoint
│ ├── routes.ts # Defines our routes
│ ├── authController.ts # Handles all of our endpoints
│ └── userService.ts # Service to manage User data
└── ...
```## 2. Setup
### 2.1. Configure environment variables
Please follow our [Getting started](https://docs.corbado.com/overview/getting-started) page to create and
configure a project in the [developer panel](https://app.corbado.com).Use the values you obtained above to configure the following variables inside `.env`:
1. **CORBADO_PROJECT_ID**: The project ID.
2. **CORBADO_API_SECRET**: The API secret.
3. **CORBADO_FRONTEND_API**: The frontend API URL.
4. **CORBADO_BACKEND_API**: The backend API URL.### 2.2. Run the Express App
Use the following command to install all dependencies:
```
npm i
```Now, you're ready to run the app like this:
```
npm run start
```## 3. Usage
After step 2 your local server should be fully working.
### 3.1. Test authentication
If you now visit `http://localhost:3000`, you should be seeing our authentication UI.
Create an account and take a look at the profile page under `/profile` you'll be forwarded to.