Customizing REST requests

Overview

Atoti Sign-Off communicates with the application server via a REST API. HTTP clients are used to send the REST requests. The Spring RestClient is the default HTTP client used.

Default Behavior

By default, the REST requests are authenticated using a JWT token that is generated by the IJwtService. Users can customize this authentication mechanism to use a different method, such as Basic Authentication.

Configuring the Requests

We ship two different clients to communicate with the application server, one that uses JWT authentication and one that uses Basic authentication. The JWT client is used by default via the property sign-off.application.authentication-mode=jwt, but you can switch to the Basic client by setting the property
sign-off.application.authentication-mode=basic.

Customizing the Requests

To customize the REST requests you need to implement your own implementation of the ISignOffRestClientBuilder interface:

ISignOffRestClientBuilder

For more information on creating a custom RestClient.Builder, refer to the Spring documentation. Alternatively, you can check out SignOffJwtAuthRestClientBuilder or SignOffBasicAuthRestClientBuilder to see how we implemented the default clients.

SignOffJwtAuthRestClientBuilder
SignOffBasicAuthRestClientBuilder