Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corbado/example-passkeys-nextauth
NextAuth.js repository of an integration example that offers passkey authentication.
https://github.com/corbado/example-passkeys-nextauth
authjs faceid fido2 javascript nextauth nextjs passkey passkeys touchid webauthn
Last synced: 28 days ago
JSON representation
NextAuth.js repository of an integration example that offers passkey authentication.
- Host: GitHub
- URL: https://github.com/corbado/example-passkeys-nextauth
- Owner: corbado
- License: isc
- Created: 2023-09-13T07:35:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-15T11:25:33.000Z (11 months ago)
- Last Synced: 2024-07-30T19:49:13.369Z (5 months ago)
- Topics: authjs, faceid, fido2, javascript, nextauth, nextjs, passkey, passkeys, touchid, webauthn
- Language: TypeScript
- Homepage: https://www.corbado.com/passkeys/next-js
- Size: 116 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NextAuth.js Passkey Integration Example
This is a sample implementation of a NextAuth.js application that offers passkey authentication. For simple passkey-first authentication, Corbado's [passkey association approach](https://docs.corbado.com/products/corbado-connect/connect-via-passkey-association) is used.
Please see the [full blog post](https://www.corbado.com/blog/passkeys-nextauth) to understand the detailed steps needed to integrate passkeys with NextAuth.js.
## File structure
```
├── pages
| ├── api
| | ...
| | └── auth
| | ├── [...nextauth].ts # Configuration of the authentication providers
| | └── associate.ts # Endpoint which requests an association token from Corbado
| |
| ├── auth
| | ├── redirect.tsx # Page where the user gets redirected to by Corbado after authentication
| | └── signin.tsx # Sign in page which also contains the Corbado login web component
| |
| └── index.tsx # Main page which is shown when no path is given
|
├── .env.local # Contains the environment variables
```## Prerequisites
Please follow the steps in [Getting started](https://docs.corbado.com/overview/getting-started) to create and configure
a project in the [Corbado developer panel](https://app.corbado.com/signin#register).Create a .env.local file and paste your Corbado project ID in there as well as credentials for at least one OAuth provider as shown in .env.local.
## Usage
Then you can run the project locally by executing the following command:
```bash
npm install && npm run dev
```