An open API service indexing awesome lists of open source software.

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

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.