Basic HTTP Authentication

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.30.19