Products Downloads


French version



 


This template is a Gradle project template for building a standalone authentication server enabling a JWT token to be provided based on a user's credentials (can be used to authenticate a Web application hosting REST Adelia Web services). The produced application is a J2EE application in the form of a file in WAR format. It must be run in an Apache Tomcat J2EE container server.

Creating a jwtProviderStandAlone build project

The project is created by decompressing the %ADELIWS%\Build\templates\jwtProviderStandAlone application.zip file: the obtained "jwtProviderStandAlone application" directory can be moved and renamed as required.


The application build machine and Adelia build machine may be two different machines.

Configuring a jwtProviderStandAlone build project

After creating a project, it needs to be configured before it can be executed.


Build project configuration and initialization are based on the settings entered in the gradle.properties file, namely:


General settings

adeliaVersion (mandatory)

Alphanumeric string representing the version number of the Adelia runtime included in the Web application WAR.


This runtime version must be higher than or equal to the one used by the Adelia build machine to generate artifacts.


version (mandatory)

Alphanumeric string representing the application version number. Each artifact built will have the same version number. There are several version types:

    • The release (or final) versions representing the official versions of the application (e.g. 1.0.0),

    • The snapshot (or instantaneous) versions representing the versions of the application that are under development (e.g. 1.0.1-SNAPSHOT),

    • The pre-release (or release-candidate) versions representing the versions which are candidates for being final versions (e.g. 1.0.1-RC01).


group (mandatory)

Alphanumeric string representing the identifier of the group or organization instigating the project.

The value follows the same naming rules as the Java packages (e.g. com.hardis) and we generally choose the name of the project's top package as a value.


appWarName (optional)

Alphanumeric string representing the name of the produced WAR file.

By default, the name of this file is <project directory name>-<version parameter value>. war file.

If this parameter is entered, the file name will be < appWarName parameter value>-<version parameter value>.war.


adeliaLoginModule (optional)

Calls a Visual Adelia Batch program to manage authentication with a Realm. This parameter has a "Y" (support added) or "N" (no support added) alphanumeric value. This parameter takes the "N" value by default.

Activating this property involves declaring a dependency on an Adelia build component which contains the program managing authentication.


ldapLoginModule (optional)

Calls LDAP authentication. This parameter has a "Y" (support added) or "N" (no support added) alphanumeric value. This parameter takes the "N" value by default.


↑ Top of page


Repository manager settings

Artifact repositories are used during the following phases when executing a jwtProviderStandAlone build:

  • In the WAR file creation phase, the build uses a repository to download (download repository) the artifacts required to build the application artifact.
    These artifacts are:

    • the Adelia runtime artifacts required to run the application,

    • your own Adelia object artifacts comprising the application (components required for authentication by Adelia module): these are generated by the execution of an Adelia build project.


  • In the final storage phase for the built artifact, a repository (upload repository) can be defined to transfer this versioned artifact.
    According to the version type (release or snapshot), the associated repository can be defined.


downloadArtifactsReleaseRepo (mandatory)

Access URL to the download repository of the dependent artifacts needed for the build. This repository should make it possible to access:

    • Hardis repository artifacts (Adelia runtime),

    • your own Adelia object artifacts comprising your application.  These artifacts are in release version if you build your web application in the release version.

By default, and for example purposes only, the value of this parameter is the URL of the repository provided by Hardis.


In its place, in your Nexus, you need to create your own private repository so the Hardis repository and your private repository are grouped together in the release version. Depending on your own Nexus configuration used for your Adelia build projects, it is either the repository created by default by Nexus and called "Releases", or another "hosted repository" with a "Repository policy" set to Release and created by you.


To do this, after logging in to Nexus, in the "Repositories" view, add a new repository defined as a group of repositories described above:

    • Open the repository definition window via the "Add repository group" command,

    • From the "Available Repositories" section, add, in the "Ordered Group Repositories" section, the private repository which is a proxy of the Hardis repository as well as the private "hosted repository used to store your artifacts in release version.

To finish, replace the downloadArtifactsReleaseRepo parameter value with the "Repository Path" URL of the newly created group repository.



downloadArtifactsReleaseRepo.username / downloadArtifactsReleaseRepo.password (optional)

Defines the user profile and password used to connect to the download repository.

By default, and by way of example, these identifiers are those of the Hardis download repository but they need to be replaced by those of your own group private repository (see downloadArtifactsReleaseRepo above).


When you access this repository in read-only mode, Nexus authorizes an anonymous connection: in this case, leave the "username" and "password" fields blank.


downloadArtifactsSnapshotRepo (optional)

Access URL to the download repository of the dependent artifacts needed for the build. This repository should make it possible to access:

    • Hardis repository artifacts (Adelia runtime). These artifacts are only available in the release version,

    • your own Adelia object artifacts comprising your application. These artifacts are in snapshot version if you build your own web application in snapshot version.

In your Nexus, you need to create your own private repository so the Hardis repository and your private repository are grouped together in the snapshot version. Depending on your own Nexus configuration used for your Adelia build projects, it is either the repository created by default by Nexus and called "Snapshots", or another "hosted repository" with a "Repository policy" set to "Snapshot "and created by you.


To do this, after logging in to Nexus, in the "Repositories" view, add a new repository defined as a group of repositories described above:

    • Open the repository definition window via the "Add repository group" command,

    • From the "Available Repositories" section, add, in the "Ordered Group Repositories" section, the private repository which is a proxy of the Hardis repository as well as the private "hosted repository used to store your artifacts in snapshot version.

To finish, replace the downloadArtifactsSnapshotRepo parameter value with the "Repository Path" URL of the newly created group repository.


downloadArtifactsSnapshotRepo.username / downloadArtifactsSnapshotRepo.password (optional)

Defines the user profile and password used to connect to the download repository. This profile should enable you to access your own private group repository (see downloadArtifactsSnapshotRepo above).

When you access this repository in read-only mode, Nexus authorizes an anonymous connection: in this case, leave the "username" and "password" fields blank.


uploadArchivesReleaseRepo (optional)

Access URL to the upload repository used to store the WAR artifact built with a release version.

This repository enables the artifacts to be made available in the final version.


uploadArchivesReleaseRepo.username / uploadArchivesReleaseRepo.password (optional)

Defines the user profile and password used to connect to the artifact upload repository in the release version.


uploadArchivesSnapshotRepo (optional)

Access URL to the upload repository used to store the WAR artifact built with a snapshot version.

This repository enables the artifacts under development to be made available.


uploadArchivesReleaseRepo.username / uploadArchivesReleaseRepo.password (optional)

Defines the user profile and password used to connect to the artifact upload repository in the snapshot version.


↑ Top of page

Configuring components of the wtProviderStandAlone application to build

These components are the Adelia object artifacts generated by the execution of an Adelia build project.

They need to be declared in the jwtProviderStandAlone build project so they can be added to the produced WAR.


To do this:

  • open the build.gradle file with a text editor, then;

  • in the "dependencies" section (Declare your artifacts needed to build the web application here), declare your artifacts.

CloudEventB-type artifacts

During authentication by adeliaLoginModule, you need to declare a dependency on an artifact containing the Visual Adelia Batch program which manages authentication.

This artifact must be declared by inserting the following instruction:

runtimeOnly group: '<artifact group name>', name: '<artifact file name without version>', version: '<artifact version number>'


Example of declaration of artifact generated by an application area-based build:

For the CloudEventB artifact with the file name myapp-app_area_1_ cloudeventb -1.1.0-SNAPSHOT.jar, enter runtimeOnly group: 'my.company', name: 'myapp-app_area_1_cloudeventb', version: '1.1.0-SNAPSHOT'.

The group value is that of the "group" setting in the gradle.properties file of the Adelia build project which built the artifact.


Example of declaration of artifact generated by a component-based build:

For the CloudEventB artifact with the file name prefix_compo_1_ cloudeventb -1.1.0-SNAPSHOT.jar, enter runtimeOnly group: 'my.company', name: 'prefix_compo_1_cloudeventb', version: '1.1.0-SNAPSHOT'.

The group value is that of the "groupId" setting of the component which generates the artifact.

↑ Top of page

Executing a jwtProviderStandAlone build project

List of Gradle tasks for REST Web services build


build

WAR artifact build task. This is placed in the build\libs sub-directory of the build project.


clean

Task used to delete objects created when executing the build task (the build sub-directory is deleted).


uploadArchives

This task is used to transfer the built artifact to the upload repository.

You must specify the uploadArchivesReleaseRepo or uploadArchivesSnapshotRepo key, depending on the artifact version type.

↑ Top of page

  • Aucune étiquette