Custom Authentication Module

Last modified: 20 April 2023

There are two types of custom authentication modules, which can be provided by plugins: credentials authentication modules and HTTP authentication modules. The first ones are used to check the credentials user typed in login form on the login page. The second ones are used to authenticate a user by HTTP request without showing login page at all.

Credentials Authentication Module



Credentials authentication modules API is based on Sun JAAS API. To provide your own credentials authentication module you should provide a login module class which must implement the interface javax.security.auth.spi.LoginModule and register it in the jetbrains.buildServer.serverSide.auth.LoginConfiguration.

To make the authentication module active its type name can then be used during Configuring Authentication Settings.

For example:

Now we should register this module in the server. To do so, we create a login module descriptor:

Finally we should create build-server-plugin-ourUserAuth.xml and zip archive with plugin classes as it is described Plugins Packaging and write there CustomLoginModuleDescriptor bean:

Now you should be able to Configuring Authentication Settings to your authentication module.

HTTP Authentication Module



To provide your own HTTP authentication module you should provide a class which must implement the interface jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationScheme and register it in the jetbrains.buildServer.serverSide.auth.LoginConfiguration.

To make the authentication module active its type name can then be used during Configuring Authentication Settings.

For example:

Finally we should create build-server-plugin-ourUserAuth.xml and zip archive with plugin classes as it is described Plugins Packaging and write there CustomHttpAuthenticationScheme bean:

Now you should be able to Configuring Authentication Settings to your authentication module.