use of org.mule.runtime.core.api.security.SecurityManager in project mule by mulesoft.
the class DefaultAuthenticationHandler method setAuthentication.
/**
* {@inheritDoc}
*/
@Override
public void setAuthentication(List<String> securityProviders, Authentication authentication) throws SecurityProviderNotFoundException, SecurityException, UnknownAuthenticationTypeException {
if (!securityProviders.isEmpty()) {
// This filter may only allow authentication on a subset of registered
// security providers
SecurityManager localManager = new DefaultMuleSecurityManager();
for (String sp : securityProviders) {
SecurityProvider provider = manager.getProvider(sp);
if (provider != null) {
localManager.addProvider(provider);
} else {
throw new SecurityProviderNotFoundException(sp);
}
}
this.manager = localManager;
}
setAuthentication(authentication);
}
use of org.mule.runtime.core.api.security.SecurityManager in project mule by mulesoft.
the class MuleContextLifecycleTestCase method buildStartedMuleContext.
private MuleContext buildStartedMuleContext() throws Exception {
ctx.initialise();
// DefaultMuleContext refuses to start without these objects in place
SecurityManager securityManager = mock(SecurityManager.class);
((MuleContextWithRegistries) ctx).getRegistry().registerObject(UUID.getUUID(), securityManager);
QueueManager queueManager = mock(QueueManager.class);
((MuleContextWithRegistries) ctx).getRegistry().registerObject(UUID.getUUID(), queueManager);
ctx.start();
return ctx;
}
Aggregations