https://github.com/jonaskello/keycloak-example
Keycloak example with both client and server in typescript
https://github.com/jonaskello/keycloak-example
Last synced: 11 months ago
JSON representation
Keycloak example with both client and server in typescript
- Host: GitHub
- URL: https://github.com/jonaskello/keycloak-example
- Owner: jonaskello
- Created: 2019-04-22T08:43:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T22:02:14.000Z (about 7 years ago)
- Last Synced: 2024-10-05T02:21:06.310Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 242 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# keycloak-example
Keycloak example with both client and server in typescript
## Description
This example uses the keycloak npm packages:
- [`keycloak-js`](https://www.npmjs.com/package/keycloak-js) for the client-side ([docs](https://www.keycloak.org/docs/2.5/securing_apps/topics/oidc/javascript-adapter.html)).
- [`keycloak-connect`](https://www.npmjs.com/package/keycloak-connect) for the server-side ([docs](https://www.keycloak.org/docs/2.5/securing_apps/topics/oidc/nodejs-adapter.html)).
## How to start
### Start and setup Keycloak
First start a keycloak server:
```
$ docker run --name keycloak -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=H2 -d jboss/keycloak
```
This will start the keycloak server at http://localhost:8080. Login and do the following:
- Create realm called `mydemo`
- Create client called `my-react-client` with root url `http://localhost:3000`.
- Create a user `john` with password `john`.
### Start the example application
```bash
$ yarn # install
$ yarn start # start
```
The above will start the application server at http://localhost:3000.
Open the example application in the browser and press the secure link, login as `john`.