keycloakify / oidc-spa

Openid connect client for Single Page Applications
https://www.oidc-spa.dev
MIT License
48 stars 6 forks source link
keycloak oidc oidc-client typescript

oidc-spa


We're here to help!

Home - Documentation

An Open ID Connect client tailored for Single Page Applications, particularly suitable for Vite projects.\ This library is intended for scenarios such as integrating your application with Keycloak.

In straightforward terms, this library is ideal for those seeking to enable user login/registration in their web application. When used in conjunction with Keycloak (for example), it enables you to offer a modern and secure authentication experience with minimal coding effort. This includes options for signing in via Google, X, GitHub, or other social media platforms. We provide comprehensive guidance from beginning to end.

Comparison with Existing Libraries

oidc-client-ts

While oidc-client-ts serves as a comprehensive toolkit, our library aims to provide a simplified, ready-to-use adapter that will pass any security audit and that will just work out of the box on any browser.
We utilize oidc-client-ts internally but abstract away most of its intricacies.

react-oidc-context

react-oidc-context is a React wrapper around oidc-client-ts.
oidc-spa also feature a carefully crafted React API that comes with example integration with:

keycloak-js

The official OIDC Client for Keycloak. It only works with Keycloak and will eventually be deprecated.

NextAuth.js

NextAuth.js is a authentication solution for Next.js and features a Keycloak adapter.
oidc-spa is specifically designed for Single Page Applications, Next.js projects do not call in this category, so NextAuth.js is what you should use if you're using Next.js.

NOTE: We might create in the future a oidc-mpa library for Multi Page Applications that would aim at supporting Next.js projects.

🚀 Quick start

Heads over to the documentation website 📘!

Sponsor


![Logo Dark](https://github.com/user-attachments/assets/935c0f10-6f7b-41f4-94cc-4540d0985569#gh-dark-mode-only)
![Logo Light](https://github.com/user-attachments/assets/2e5bce29-4149-44fc-9d17-789e17e9642b#gh-light-mode-only)


Keycloak Consulting Services - Your partner in Keycloak deployment, configuration, and extension development for optimized identity management solutions.

Thank you, Zone2, backing the project!

Showcases

This library powers the authentication of the following platforms:

Onyxia

image

The French Interministerial Base of Free Software

image