use of org.dcache.gplazma.plugins.GPlazmaAuthenticationPlugin in project dcache by dCache.
the class DefaultAuthenticationStrategy method authenticate.
/**
* Devegates execution of the {@link GPlazmaAuthenticationPlugin#authenticate(SessionID,
* Set<Object>,Set<Object>, Set<Principal>) GPlazmaAuthenticationPlugin.authenticate} methods of
* the plugins supplied by {@link GPlazmaStrategy#setPlugins(List< GPlazmaPluginService <T>>)
* GPlazmaStrategy.setPlugins} to {@link PAMStyleStrategy#callPlugins(PluginCaller<T>)
* PAMStyleStrategy.callPlugins(PluginCaller<T>)} by providing anonymous implementation of the
* {@link PluginCaller#call(GPlazmaPlugin) PluginCaller} interface.
*
* @see PAMStyleStrategy
* @see PluginCaller
*/
@Override
public void authenticate(final LoginMonitor monitor, final Set<Object> publicCredential, final Set<Object> privateCredential, final Set<Principal> identifiedPrincipals, final Set<Restriction> restrictionStore) throws AuthenticationException {
pamStyleAuthentiationStrategy.callPlugins(service -> {
monitor.authPluginBegins(service.getName(), service.getControl(), publicCredential, privateCredential, identifiedPrincipals);
GPlazmaAuthenticationPlugin plugin = service.getPlugin();
Result result = Result.FAIL;
String error = null;
try {
plugin.authenticate(publicCredential, privateCredential, identifiedPrincipals, restrictionStore);
result = Result.SUCCESS;
} catch (AuthenticationException e) {
error = e.getMessage();
throw e;
} finally {
monitor.authPluginEnds(service.getName(), service.getControl(), result, error, publicCredential, privateCredential, identifiedPrincipals);
}
});
}
Aggregations