if (loginErrorPage == null) {
throw new AuthException("'loginErrorPage' "
+ "must be supplied as a property in the provider-config "
+ "in the domain.xml file!");
}
ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
Domain domain = habitat.getService(Domain.class);
NetworkListener adminListener = domain.getServerNamed("server").getConfig().getNetworkConfig().getNetworkListener("admin-listener");
SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
final String host = adminListener.getAddress();
// Save the REST URL we need to authenticate the user.
this.restURL = (SecureAdmin.Util.isEnabled(secureAdmin) ? "https://" : "http://") +
(host.equals("0.0.0.0") ? "localhost" : host) + ":" + adminListener.getPort() + "/management/sessions";