OIDC SPA
source link: https://www.oidc-spa.dev/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
IDC SPA
The Openid Connect client library you've been waiting for.
Let's integrate Keycloak with your web application.
Oidc-spa is a generic OpenID Connect client for Single Page Applications (e.g: Vite).
It is a library that you use to redirect your users to an authentication server like Keycloak when they click on your Sign-in button.
Accessible to all skill levels
In the documentation, we do not assume that you are an expert in OIDC or Keycloak. We offer comprehensive guidance from start to finish, aiming to demystify the technical jargon.
React Integration
Oidc-spa is not tied to any particular UI framework. However, we provide a React API and example projects demonstrating integration withTanstack orReact Router.
TypeScript
Expect best in class type safety: Enhanced API response types based on usage context. Optional Zod integration for validating the user profile from the JWT.
Easy to set up
There is no need for creating special /login
/logout
routes. Just a login()
function to call when you want to redirect your user to the login/registration pages.
Minimal API surface
The library indicates whether the user is authenticated. If they are, you obtain the user profile, a bearer token for calling your API, and a logout()
function. That's all you need.
Auto logout
Effortless setup forautomatic logout after a specified period of inactivity. Are you still there? You will be automatically logged out in 10...9...
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK