Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inloco/incognia-demo-api-ruby
API for Incognia Demo App implemented in Ruby
https://github.com/inloco/incognia-demo-api-ruby
Last synced: 7 days ago
JSON representation
API for Incognia Demo App implemented in Ruby
- Host: GitHub
- URL: https://github.com/inloco/incognia-demo-api-ruby
- Owner: inloco
- Created: 2022-04-14T14:55:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-22T19:25:08.000Z (10 months ago)
- Last Synced: 2024-03-22T20:35:27.506Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 671 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Incognia Demo API and Web App
[![Ruby](https://github.com/inloco/incognia-demo-api/actions/workflows/ci.yml/badge.svg)](https://github.com/inloco/incognia-demo-api/actions/workflows/ci.yml)
This is a sample API and Web app that uses [Incognia Ruby library](https://github.com/inloco/incognia-ruby) to easily integrate to Incognia API.
At this repository you can better understand:* How you can place Incognia inside your server
* How you can leverage Incognia solution to implement Web authentication supported by a mobile device## Available endpoints
This API responds to the below endpoints:
* Register signup: `POST /signups`
* Reassess signup: `GET /signups/:id`
* Signin: `POST /signin`
* This endpoint uses Incognia API to decide between frictionlessly sign in the user or sending an OTP through email.
* Validate signin OTP: `POST /signin/validate_otp`
* Validate signin QR code (mobile supported Web login): `POST /signin/validate_qrcode`
* Assess user login and signup: `POST /users/:user_id/assessments/assess`
* Return user latest assessments: `GET /users/:user_id/assessments/latest`The Web App has below pages:
* Login: `/web/session/new`
* Dashboard (signed section): `/web/dashboard`## How to run this API locally?
### Application setup
The application requires Ruby 3.1.2. With this Ruby version in place, install `bundler` and run `bundle install` from the root of the repository.
To check if everything is fine, you can run the test suite with `rake spec`.
### Running with your organization credentials
1. Generate Incognia API credentials at Incognia dashboard
2. Set the `client_id` and `secret` at `.env` file
3. Run the server: `rails s` (API will listen at port 3000)## How to run this API with Docker?
1. Generate Incognia API credentials at Incognia dashboard
2. Set the `client_id` and `secret` at `.env` file
3. Run Docker Compose: `docker-compose up` (API will listen at port 3000)