Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keycloakify/oidc-spa
Openid connect client for Single Page Applications
https://github.com/keycloakify/oidc-spa
keycloak oidc oidc-client typescript
Last synced: 21 days ago
JSON representation
Openid connect client for Single Page Applications
- Host: GitHub
- URL: https://github.com/keycloakify/oidc-spa
- Owner: keycloakify
- License: mit
- Created: 2023-10-21T13:32:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-14T18:06:35.000Z (29 days ago)
- Last Synced: 2024-11-14T19:21:43.925Z (29 days ago)
- Topics: keycloak, oidc, oidc-client, typescript
- Language: TypeScript
- Homepage: https://www.oidc-spa.dev
- Size: 737 KB
- Stars: 67
- Watchers: 4
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
![oidc-spa](https://github.com/keycloakify/oidc-spa/assets/6702424/3375294c-cc31-4fc1-9fb5-1fcfa00423ba)
An Open ID Connect client tailored for Single Page Applications, particularly suitable for [Vite](https://vitejs.dev/) projects.\
This library is intended for scenarios such as integrating your application with [Keycloak](https://www.keycloak.org/).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.
- 🎓 Accessible to all skill levels; no need to be an OIDC expert. And we are here to help [on Discord](https://discord.gg/mJdYJSdcm4).
- 🛠️ Easy to set up; eliminates the need for creating special `/login` `/logout` routes.
- 💬 Helpful debug message telling you what's wrong in your configuration and how to fix it.
- 🎛️ Minimal API surface for ease of use.
- 🕣 Easy implementation of auto logout. _Are you still there? You will be logged out in 10...9..._
- ✨ Robust yet optional React integration.
- 📖 Comprehensive documentation and project examples: End-to-end solutions for authenticating your app.
- ✅ Best in class type safety: Enhanced API response types based on usage context.## Comparison with Existing Libraries
### [oidc-client-ts](https://github.com/authts/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](https://github.com/authts/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:- [`@tanstack/react-router`](https://docs.oidc-spa.dev/example-setups/tanstack-router)
- [`react-router-dom`](https://docs.oidc-spa.dev/example-setups/react-router)### [keycloak-js](https://www.npmjs.com/package/keycloak-js)
The official OIDC Client for Keycloak. It only works with Keycloak and [will eventually be deprecated](https://www.keycloak.org/2023/03/adapter-deprecation-update).
### [NextAuth.js](https://next-auth.js.org/)
NextAuth.js is a authentication solution for Next.js and features a [Keycloak adapter](https://next-auth.js.org/providers/keycloak).
`oidc-spa` is specifically designed for Single Page Applications, Next.js projects **do not** fall 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](https://docs.oidc-spa.dev) 📘!
## Sponsors
Project backers, we trust and recommend their services.
![Logo Dark](https://github.com/user-attachments/assets/d8f6b6f5-3de4-4adc-ba15-cb4074e8309b#gh-dark-mode-only)
![Logo Light](https://github.com/user-attachments/assets/20736d6f-f22d-4a9d-9dfe-93be209a8191#gh-light-mode-only)
Keycloak as a Service - Keycloak community contributors of popular extensions providing free and dedicated Keycloak hosting and enterprise Keycloak support to businesses of all sizes.
![Logo Dark](https://github.com/user-attachments/assets/dd3925fb-a58a-4e91-b360-69c2fa1f1087#gh-dark-mode-only)
![Logo Light](https://github.com/user-attachments/assets/6c00c201-eed7-485a-a887-70891559d69b#gh-light-mode-only)
## Showcases
This library powers the authentication of the following platforms:
### Onyxia
- [Source code](https://github.com/InseeFrLab/onyxia)
- [Public instance](https://datalab.sspcloud.fr)### The French Interministerial Base of Free Software
- [Source code](https://github.com/codegouvfr/sill-web/)
- [Deployment of the website](https://sill-preprod.lab.sspcloud.fr/)