Keycloak
This information is incomplete. |
---|
Installation
Download and extract the latest version of Keycloak.
Keycloak Setup
Starting Keycloak
- Open a terminal and navigate to the keycloak-<version>\bin folder.
- Enter the following command to start Keycloak:
kc.bat start-dev
warning Using the start-dev parameter is only meant for the first time setup. It is not recommended for production environments. - Open a web browser and browse to localhost:8080.
Creating An Admin Account
- Fill the form with a username and password to create the admin account.
- Click the Open Administration Console button and log in with the admin account.
- Navigate to http://localhost:8080/admin to access the Admin Console.
- Log in using the credentials of the admin account.
Creating A Realm And A User
- In the Administration Console, click on the drop-down menu at the top-left of the page and select Create realm.
- Enter a name for the realm. For example, "AMTRealm" and click the Create button.
- Within the newly created realm, click Users in the menu on the left side.
- Click Create new user.
- Enter a value for the following fields:
- Username
- First name
- Last name
- Click the Create button.
- Click Credentials.
- Enter a password for the new user.
- Confirm the password by re-entering it in the Password confirmation field.
- Click the Save button.
Optional – Verifying User Configuration
- Navigate to http://localhost:8080/realms/myrealm/account to open the Account Console.
- Log in using the credentials of the user created in the previous section.
- From the Account Console, the user configuration can be verified and the account and profile can be managed.
Securing An Application
- Navigate to http://localhost:8080/admin to access the Admin Console.
- Within the realm, click Clients in the sidebar menu, then click the Create client button.
- In the General settings menu, configure the following:
- Client type: OpenID Connect
- Client ID: amt-java-cc
- Name: AMT Java Control Center
- Click the Next button.
- Leave the Capability settings as is and click the Next button.
- Configure the following Login settings:
- Root URL: http://localhost:4200
- Home URL: http://localhost:4200
- Valid redirect URIs:
- http://localhost:4200/*
- http://localhost:4300/*
- Valid post logout redirect URIs: None
- Web origins:
- http://localhost:4200
- http://localhost:4300
Creating A Client Scope
- Navigate to Client scopes in the sidebar menu, then click the Create client scope button.
- Configure the following Client scope settings.
- Name: audience_scope
- Description: A scope to append correct audiences to access tokens
- Type: None
- Click the Save button.
- Click the Mappers tab and click on Configure a new mapper to configure the following:
- Name: audience mapper
- Included Client Audience: amt-java-cc
- Add to access token: On
- Click the Save button.