--JDK 8 or above
--Installation is required in advance
--Please also set the environment variable JAVA_HOME
Download the [Standalone server distribution] ZIP file from the Official Page. Then just unzip it to a suitable local folder.
Start with standalone.sh
(standalone.bat
on Windows) in the folder/binwhere you extracted
Keycloak.
The default port number is 8080. Add the -Djboss.http.port
option to change the port number.
Example of booting on port number 9000
$ cd bin
$ ./standalone.sh -Djboss.http.port=9000
Open http: // localhost: 9000 (the port number should be the one specified at startup) in a web browser, and in the [Administration Console] on the left side of the screen, enter the administrator user name and password (this time both admin
). And click Create.
If successful, [User Created] will be displayed.
Click the [Administration Console] part to display the administrator login screen.
Enter the set user name and password and click [Log In].
Move the mouse cursor around [Master] on the upper left of the screen and click [Add realm] that appears.
Enter an arbitrary realm name (hello-api
in this case) in [Name] and click [Create].
Click Users on the left side of the screen, then click Add user on the right side of the screen.
Enter user
in Username and click Save.
Open the Credentials tab, set Password and Password Confirmation (both user
this time), set Temporary to OFF and click Set Password.
Click Client Scopes on the left side of the screen, then click Create on the right side of the screen.
In Name, enter the scope name (in this case hello
) and click Save.
Click Clients on the left side of the screen, then click Create on the right side of the screen.
Client_id in [Client ID](this time hello-client
)
Then enter the client's root URL (in this case http: // localhost: 8080
) in the Root URL and click Save.
Open the [Settings] tab, set [Access Type] to [confidential], and set [Valid Redirect URIs] to the client redirect URL (this time http: // localhost: 8080/login/oauth2/code/todo-client
). Type it in and click Save.
Open the Client Scopes tab, select the scope you want to add (in this case hello
) in Default Client Scopes and click Add selected. Success if the selected scopes are moved to Assigned Default Client Scopes.
Recommended Posts