Skip to content

An example nextjs 13 application that authenticates using keycloak

Notifications You must be signed in to change notification settings

jackkweyunga/nextjs-keycloack-example

Repository files navigation

NEXTJS KEYCLOACK EXAMPLE

A demonstration on how nextjs application can be configured to work with a keycloak OIDC server to achieve a kind of authentication used in the microservices' architecture.

next-auth is used together with the keycloak provider to handle authentication.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Make sure to add a .env file

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=somesecret

KEYCLOAK_ISSUER=http://localhost:8080/realms/<client-id>
KEYCLOAK_SECRET=<client-secret>
KEYCLOAK_ID=<client-id>

Open http://localhost:3000 with your browser to see the result.

About

An example nextjs 13 application that authenticates using keycloak

Resources

Stars

Watchers

Forks

Releases

No releases published