Baseline setup with reference-apps using KEYCLOAK!
See also medium-article
In order to build and run this app you need to have a couple of things installed:
- The Docker Toolbox or native Docker, whatever you prefer. See Docker and Docker-Compose
- (for dev) An IDE for the development, like Atom or IntelliJ
- (for dev) Node.js, npm, and Yarn installed, see package.json for the required versions.
- (for dev) Get familiar with VueJS.
- (for dev) Get familiar with Spring Boot
Building and running via Docker and Docker-Compose:
$ docker-compose up --build
# NOTE: in linux-env you might have permission problems with 'docker-data-*' folders
# to fix; stop docker-compose, set permissions as below, then run docker-compose again.
$ sudo chown 1001:1001 -R docker-data-*
# to shut it down, ctrl+c and
$ docker-compose down
docker-compose up
gets Keycloak instance up and running in your local environment.
Now you can access Keycloak admin panel via http://localhost:8081
the default admin username+passwd is inside docker-compose.yaml
After you login, you need to setup a Realm and Client!
NB! By default, docker-compose while starting should also reimport default config like realm, client and users.
If you still want to do this manually:
To learn more about creating a realm/clients/users, see https://www.keycloak.org/docs/latest/server_admin/index.html#admin-console
p.s. You can also reuse the first part of baeldung-tutorial*.
Here is just an outline of what you need to do for running these examples:
- create a realm named
KeycloakExampleApp
- turn off the requirement of ssl for this realm (realmsettings -> login -> require ssl -> none)
- create a client named
login-app
with default Client IDopenid-connect
and AccessType aspublic
. And also set Valid Redirect URIs ashttp://localhost:8081/*
which is the base URI of keycloak server. - create a user Role (Roles -> add role)
- create a user named
myuser
with passwordmypass
(Users -> add user). Make sure to activate, Role Mapping touser
role.
the resulting keycloak.json
should yield:
{
"realm": "KeycloakExampleApp",
"auth-server-url": "http://localhost:8081/auth",
"ssl-required": "none",
"resource": "login-app",
"public-client": true,
"confidential-port": 0
}
NB! Client settings requires Valid Redirect URIs for each of the reference-app, see
After you've done all the config, now you can use Reference Apps which are listed below.
See list of reference implementations