An open API service indexing awesome lists of open source software.

https://github.com/corbado/example-passkeys-ruby-react

Ruby on Rails & React repository of a sample app that offers passkey authentication.
https://github.com/corbado/example-passkeys-ruby-react

faceid fido2 javascript passkey passkeys react ruby ruby-on-rails touchid webauthn

Last synced: 6 months ago
JSON representation

Ruby on Rails & React repository of a sample app that offers passkey authentication.

Awesome Lists containing this project

README

          

# Ruby on Rails & React Passkey Example App

This is a sample implementation of a Ruby on Rails application with a React.js frontend that offers passkey
authentication. For simple passkey-first authentication, the Corbado UI components are used.

Please read the [full blog post](https://www.corbado.com/blog/passkeys-ruby-on-rails-react) to see all the required
steps to integrate passkeys into a Ruby on Rails / React app.

## File structure

```
...
├── app
| ...
| ├── controllers
| | └── pages_controller.rb # Controller for our pages
| |
├── config
| ...
| ├── environments
| | ├── development.rb # Development environment config
| | └── production.rb # Production environment config
| |
| └── routes.rb # The Ruby on Rails routes are configured here
|
└── frontend
...
├── .env
└── src
...
├── index.js # Root of our React.js app which also contains the React.js routes
└── routes
├── login.js # Login page containing the Corbado auth component
└── profile.js # Profile page showing information about the current user
```

## 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).

Open the `development.rb` and `production.rb` files under /config/environments and set the `corbado_project_id` variable
to your Corbado project ID.

## Usage

Build the React frontend by heading into the frontend folder with

```bash
cd frontend
```

and then run

```bash
npm i && npm run build
```

Then, you can run the project locally by executing the following command:

```bash
bin/rails s
```