2016-05-11 02:48:33 +00:00
2020-07-20 21:00:52 +00:00
[id="installing-sample-code_{context}"]
= Installing sample code to secure the application
2016-05-11 02:48:33 +00:00
2020-06-18 01:54:58 +00:00
The final procedure is to make this application secure by installing some sample code from the {quickstartRepo_link} repository. The quickstarts work with the most recent {project_name} release.
2016-05-11 02:48:33 +00:00
2021-11-10 10:45:59 +00:00
The sample code is the *app-profile-jee-vanilla* quickstart. It demonstrates how to change a Jakarta EE application that is secured with basic authentication without changing the WAR. The {project_name} client adapter subsystem changes the authentication method and injects the configuration.
2018-06-07 07:05:21 +00:00
2020-06-18 01:54:58 +00:00
.Prerequisites
2017-08-30 11:46:49 +00:00
2020-06-18 01:54:58 +00:00
You have the following installed on your machine and available in your PATH.
2018-06-07 07:05:21 +00:00
2020-06-18 01:54:58 +00:00
* Java JDK 8
* Apache Maven 3.1.1 or higher
* Git
2017-08-30 11:46:49 +00:00
2020-06-18 01:54:58 +00:00
You have a *keycloak.json* file.
2018-06-07 07:05:21 +00:00
2020-06-18 01:54:58 +00:00
.Procedure
2016-05-11 02:48:33 +00:00
2020-06-18 01:54:58 +00:00
. Make sure your {appserver_name} application server is started.
. Download the code and change directories using the following commands.
+
2016-06-09 10:09:53 +00:00
[source, subs="attributes"]
2016-05-11 02:48:33 +00:00
----
2017-08-28 12:50:14 +00:00
$ git clone {quickstartRepo_link}
2020-06-18 01:54:58 +00:00
$ cd {quickstartRepo_dir}/app-profile-jee-vanilla/config
2016-05-11 02:48:33 +00:00
----
2020-06-18 01:54:58 +00:00
. Copy the `keycloak.json` file to the current directory.
2016-05-11 02:48:33 +00:00
2020-06-18 01:54:58 +00:00
. Move one level up to the `app-profile-jee-vanilla` directory.
2016-05-11 02:48:33 +00:00
2020-06-18 01:54:58 +00:00
. Install the code using the following command.
+
[source, subs="attributes"]
----
$ mvn clean wildfly:deploy
----
2016-05-11 02:48:33 +00:00
2020-12-23 23:54:35 +00:00
. Confirm that the application installation succeeded. Go to http://localhost:8080/vanilla where a login page is displayed.
2020-06-18 01:54:58 +00:00
+
.Login page confirming success
2020-07-20 21:00:52 +00:00
image:images/vanilla.png[Login page confirming success]
2020-06-18 01:54:58 +00:00
. Log in using the account that you created in the demo realm.
+
.Login page to demo realm
2020-07-20 21:00:52 +00:00
image:images/demo-login.png[Login page to demo realm]
2020-06-18 01:54:58 +00:00
+
A message appears indicating you have completed a successful use of {project_name} to protect a sample {appserver_name} application. Congratulations!
+
.Complete success
2020-07-20 21:00:52 +00:00
image:images/success.png[Complete success]