Usage of @BasicAuthenticationMechanismDefinition informs the container that code would the be using BasicHTTPAuthentication mechanism. This has one optional parameter, realmName, which contains the name of the realm that is sent along with WWW-Authentication Header, as follows:
@BasicAuthenticationMechanismDefinition(
realmName = "userRealm")
@ApplicationScoped
public class AppConfig{
....
}
When the code given here is used, if the container receives an unauthenticated request, it will inform the client to send the authentication details with WWW-Authentication header. The client then needs to provide authentication details for the successful execution of the request.