https://github.com/jackkweyunga/nextjs-keycloack-example
An example nextjs 13 application that authenticates using keycloak
https://github.com/jackkweyunga/nextjs-keycloack-example
Last synced: 3 months ago
JSON representation
An example nextjs 13 application that authenticates using keycloak
- Host: GitHub
- URL: https://github.com/jackkweyunga/nextjs-keycloack-example
- Owner: jackkweyunga
- Created: 2023-07-29T16:40:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-29T18:58:31.000Z (almost 3 years ago)
- Last Synced: 2025-12-08T02:48:26.246Z (8 months ago)
- Language: TypeScript
- Size: 65.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```
Make sure to add a `.env` file
```dotenv
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=somesecret
KEYCLOAK_ISSUER=http://localhost:8080/realms/
KEYCLOAK_SECRET=
KEYCLOAK_ID=
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.