use of org.glassfish.security.common.CNonceCache in project Payara by payara.
the class CNonceCacheFactoryImpl method createCNonceCache.
@Override
public CNonceCache createCNonceCache(String appName, String clusterName, String instanceName, String storeName) {
boolean haEnabled = (clusterName != null) && (instanceName != null) && (storeName != null);
CNonceCache cache = null;
Map<String, String> map = new HashMap<String, String>();
if (haEnabled) {
cache = cHANonceCacheProvider.get();
map.put(CLUSTER_NAME_PROP, clusterName);
map.put(INSTANCE_NAME_PROP, instanceName);
} else {
cache = cNonceCacheProvider.get();
}
if (cache != null) {
cache.init(cnonceCacheSize, storeName, nonceValidity, map);
}
return cache;
}
use of org.glassfish.security.common.CNonceCache in project Payara by payara.
the class SecurityDeployer method cleanArtifacts.
// removes security policy if needed
@Override
protected void cleanArtifacts(DeploymentContext context) throws DeploymentException {
removePolicy(context);
SecurityUtil.removeRoleMapper(context);
OpsParams params = context.getCommandParameters(OpsParams.class);
if (this.appCnonceMap != null) {
CNonceCache cache = appCnonceMap.remove(params.name());
if (cache != null) {
cache.destroy();
}
}
}
use of org.glassfish.security.common.CNonceCache in project Payara by payara.
the class SecurityDeployer method handleCNonceCacheBSInit.
private void handleCNonceCacheBSInit(String appName, Set<WebBundleDescriptor> webDesc, boolean isHA) {
boolean hasDigest = false;
for (WebBundleDescriptor webBD : webDesc) {
LoginConfiguration lc = webBD.getLoginConfiguration();
if (lc != null && LoginConfiguration.DIGEST_AUTHENTICATION.equals(lc.getAuthenticationMethod())) {
hasDigest = true;
break;
}
}
if (!hasDigest) {
return;
}
// initialize the backing stores as well for cnonce cache.
if (isHaEnabled() && isHA) {
final String clusterName = haUtil.getClusterName();
final String instanceName = haUtil.getInstanceName();
if (cnonceCacheFactory != null) {
CNonceCache cache = cnonceCacheFactory.createCNonceCache(appName, clusterName, instanceName, HA_CNONCE_BS_NAME);
this.appCnonceMap.put(appName, cache);
}
}
}
use of org.glassfish.security.common.CNonceCache in project Payara by payara.
the class CNonceCacheFactoryImpl method createCNonceCache.
@Override
public CNonceCache createCNonceCache(String appName, String clusterName, String instanceName, String storeName) {
boolean haEnabled = (clusterName != null) && (instanceName != null) && (storeName != null);
CNonceCache cache = null;
Map<String, String> map = new HashMap<String, String>();
if (haEnabled) {
cache = cHANonceCacheProvider.get();
map.put(CLUSTER_NAME_PROP, clusterName);
map.put(INSTANCE_NAME_PROP, instanceName);
} else {
cache = cNonceCacheProvider.get();
}
if (cache != null) {
cache.init(cnonceCacheSize, storeName, nonceValidity, map);
}
return cache;
}
Aggregations