use of org.mule.runtime.api.security.Authentication in project mule by mulesoft.
the class DefaultAuthenticationHandler method setAuthentication.
/**
* {@inheritDoc}
*/
@Override
public void setAuthentication(Authentication authentication) throws SecurityProviderNotFoundException, SecurityException, UnknownAuthenticationTypeException {
Authentication authResult = manager.authenticate(authentication);
if (securityContext == null) {
securityContext = manager.createSecurityContext(authResult);
}
this.securityContext.setAuthentication(authResult);
this.securityContextUpdater.accept(securityContext);
}
use of org.mule.runtime.api.security.Authentication in project mule by mulesoft.
the class MuleEventTestCase method createTestAuthentication.
private SecurityContext createTestAuthentication() {
Authentication auth = new DefaultMuleAuthentication(new DefaultMuleCredentials("dan", new char[] { 'd', 'f' }));
SecurityContext securityContext = new DefaultSecurityContextFactory().create(auth.setProperties(singletonMap("key1", "value1")));
return securityContext;
}
Aggregations