RHBK NeuroFace Biometric Flow

Red Hat Build of Keycloak with biometric facial recognition authentication via NeuroFace

RHBK 26.0 Keycloak SPI Facial 2FA OpenShift

Demo β€” Biometric Authentication Flow

Biometric Authentication Flow

Quick demo of the delegated creation and 2FA facial recognition flow with RHBK and NeuroFace

Demo β€” NeuroFace Facial Recognition

NeuroFace β€” Facial Recognition in Action

Full walkthrough of the NeuroFace webapp: training, recognition, and model configuration

Overview

πŸ”

Delegated Creation + Biometric Enrollment

Admin creates users in Keycloak. On first login, users enroll their face via webcam β€” 3 to 5 captures from different angles sent to NeuroFace for model training.

πŸ‘€

Second Factor Authentication (2FA)

After password login, users verify their identity through facial recognition. The SPI calls NeuroFace /api/recognize and matches against the enrolled profile.

πŸ“¦

Single Helm Install

One helm install deploys both RHBK and NeuroFace in the same namespace with pre-configured realm, clients, flows, and roles.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  RHBK (Keycloak 26 - UBI9)     β”‚     β”‚  NeuroFace Backend (FastAPI)     β”‚
β”‚                                 β”‚     β”‚                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚     β”‚  POST /api/images   ← enrollmentβ”‚
β”‚  β”‚ Biometric SPI (JAR)       β”‚  β”‚     β”‚  POST /api/train    ← training  β”‚
β”‚  β”‚                           │──┼─────┼─►POST /api/recognize ← verify   β”‚
β”‚  β”‚ β€’ BiometricAuthenticator  β”‚  β”‚     β”‚  GET  /api/health   ← health    β”‚
β”‚  β”‚   (2FA facial login)      β”‚  β”‚     β”‚  GET  /api/labels   ← labels    β”‚
β”‚  β”‚                           β”‚  β”‚     β”‚                                  β”‚
β”‚  β”‚ β€’ BiometricEnrollment     β”‚  β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚  β”‚   (delegated registration)β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                 β”‚     β”‚  NeuroFace Frontend (Angular 17) β”‚
β”‚  Realm: neuroface               β”‚     β”‚  ← Protected by OIDC client     β”‚
β”‚  Client: neuroface-app          β”‚     β”‚     "neuroface-app"              β”‚
β”‚  Flow: biometric browser        β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚  Flow: biometric registration   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Screenshots

NeuroFace Application
NeuroFace β€” Facial Recognition Webapp with ML (OpenCV LBPH / dlib)
OpenShift Topology
OpenShift Topology β€” RHBK + NeuroFace deployed in the same namespace
Helm Catalog
Helm Chart Catalog β€” rhbk-neuroface available on Artifact Hub
Helm Catalog NeuroFace
Helm Chart Catalog β€” NeuroFace dependency chart
NeuroFace Biometric Enrollment
Biometric Enrollment β€” Webcam facial capture during delegated user creation
NeuroFace Biometric Test
Biometric 2FA Test β€” Facial recognition verification during login
NeuroFace Biometric Test Result
Biometric Verification Result β€” Identity confirmed via NeuroFace
NeuroFace Training β€” Image Upload
Training β€” Uploading facial images to the NeuroFace model for a new user
NeuroFace Training β€” Success
Training Complete β€” Model successfully trained with the uploaded facial data
NeuroFace Training Test
Recognition Test β€” Verifying facial identity against the trained model
NeuroFace Training Test Two
Recognition Test β€” Multi-face detection and label matching in real time
NeuroFace AI Chat
AI Chat β€” Facial analysis assistant powered by Granite LLM integration

NeuroFace β€” Facial Recognition Service

NeuroFace is a facial recognition webapp built with FastAPI and Angular 17, containerized with Red Hat UBI9 certified images. It provides the ML backend that powers the biometric authentication.

API Endpoints Used by the SPI

EndpointMethodUsage
/api/healthGETHealth check before biometric operations
/api/imagesPOSTUpload facial images during enrollment (multipart)
/api/trainPOSTTrain the recognition model after enrollment
/api/recognizePOSTVerify facial identity during 2FA login
/api/labelsGETList registered biometric labels

Authentication Flows

1. Delegated Creation with Biometric Enrollment

KC Admin ──► Creates user ──► Assigns Required Action "Biometric Enrollment"
                                          β”‚
                                          β–Ό
                               User logs in with
                               temporary credentials
                                          β”‚
                                          β–Ό
                               Webcam: captures 3-5 images
                               from different angles
                                          β”‚
                                          β–Ό
                               SPI β†’ POST /api/images (label=username)
                               SPI β†’ POST /api/train
                                          β”‚
                                          β–Ό
                               biometric_enrolled = true
                               User joins group "biometric-enrolled"

2. Login with Biometric Second Factor (2FA)

User ──► Login page ──► username + password
                                β”‚
                                β–Ό
                       Biometric verification (2FA)
                       Webcam captures facial image
                                β”‚
                                β–Ό
                       SPI β†’ POST /api/recognize { "image": base64 }
                                β”‚
                                β–Ό
                       label == username AND
                       confidence >= threshold?
                          β”‚              β”‚
                         YES             NO
                          β–Ό              β–Ό
                       Access         Access
                       granted        denied

Quick Start

From Helm Repository

helm repo add rhbk-neuroface https://maximilianopizarro.github.io/rhbk-biometric-flow/
helm repo update

helm install rhbk-neuroface rhbk-neuroface/rhbk-neuroface \
  -n neuroface --create-namespace \
  --set admin.password=changeme

From Source

git clone https://github.com/maximilianoPizarro/rhbk-biometric-flow.git
cd rhbk-biometric-flow

helm dependency update helm/rhbk-neuroface
helm install rhbk-neuroface ./helm/rhbk-neuroface \
  -n neuroface --create-namespace \
  --set admin.password=changeme

Helm Chart Values

RHBK (Keycloak)

ParameterDefaultDescription
rhbk.image.repositoryregistry.redhat.io/rhbk/keycloak-rhel9RHBK image
rhbk.image.tag26.0Image tag
rhbk.replicas1Replicas
rhbk.resources.limits.cpu1CPU limit
rhbk.resources.limits.memory1GiMemory limit

Admin & Realm

ParameterDefaultDescription
admin.usernameadminBootstrap admin user
admin.passwordadminBootstrap admin password
realm.nameneurofaceRealm name
realm.displayNameNeuroFace BiometricDisplay name

Biometric Settings

ParameterDefaultDescription
biometric.confidenceThreshold65.0Minimum confidence (0-100)
biometric.maxEnrollmentImages5Max enrollment images
biometric.webcamWidth640Webcam width (px)
biometric.webcamHeight480Webcam height (px)

SPI Image

ParameterDefaultDescription
spi.image.repositoryquay.io/maximilianopizarro/rhbk-neuroface-spiSPI image
spi.image.taglatestTag

NeuroFace Subchart Overrides

ParameterDefaultDescription
neuroface.enabledtrueDeploy NeuroFace subchart
neuroface.backend.image.taglatestBackend image tag
neuroface.backend.replicas1Backend replicas
neuroface.backend.aiModellbphAI model (lbph / dlib)
neuroface.frontend.image.taglatestFrontend image tag
neuroface.frontend.replicas1Frontend replicas
neuroface.chat.enabledtrueEnable AI chat feature
neuroface.persistence.enabledtrueEnable persistent storage
neuroface.persistence.size1GiPVC size
neuroface.route.enabledtrueCreate NeuroFace Route

Route & Service

ParameterDefaultDescription
route.enabledtrueCreate RHBK OpenShift Route
route.tls.terminationedgeTLS termination
service.typeClusterIPService type
service.httpPort8080HTTP port
service.port8443HTTPS port

Realm Configuration

ComponentDetails
Clientsneuroface-app (public, PKCE S256), neuroface-backend (bearer-only)
Browser Flowbiometric browser β€” cookie OR (password + facial 2FA)
Registration Flowbiometric registration β€” delegated creation
Required Actionbiometric-enrollment β€” facial enrollment on first login
Rolesbiometric-user, biometric-admin
Groupbiometric-enrolled β€” auto-assigned after enrollment

SPI Components

ProviderTypeIDDescription
BiometricAuthenticatorAuthenticatorbiometric-authenticator2FA via NeuroFace /api/recognize
BiometricEnrollmentRequired Actionbiometric-enrollmentMulti-image facial enrollment
NeuroFaceClientInternalβ€”HTTP client for NeuroFace REST API

Links

πŸ—οΈ Artifact Hub β€” rhbk-neuroface

artifacthub.io/packages/helm/rhbk-neuroface

πŸ—οΈ Artifact Hub β€” neuroface

artifacthub.io/packages/helm/neuroface