public DefaultMuleSession(MuleSession session) { this.id = session.getId(); this.securityContext = session.getSecurityContext(); this.valid = session.isValid(); this.properties = Collections.synchronizedMap(new CaseInsensitiveHashMap()); for (String key : session.getPropertyNamesAsSet()) { this.properties.put(key, createTypedValue(session, key)); } }
throws SecurityException, SecurityProviderNotFoundException if (event.getSession().getSecurityContext() == null) throw new UnauthorisedException(event, event.getSession().getSecurityContext(), event.getEndpoint(), this); Authentication auth = event.getSession().getSecurityContext().getAuthentication(); if (isAuthenticate())
throws SecurityException, SecurityProviderNotFoundException SecurityContext securityContext = event.getSession().getSecurityContext(); if (securityContext == null)
@Override protected void authenticateOutbound(MuleEvent event) throws SecurityException, SecurityProviderNotFoundException, CryptoFailureException { SecurityContext securityContext = event.getSession().getSecurityContext(); if (securityContext == null) { if (isAuthenticate()) { throw new UnauthorisedException(event, securityContext, this); } else { return; } } Authentication auth = securityContext.getAuthentication(); if (isAuthenticate()) { auth = getSecurityManager().authenticate(auth); if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + auth.toString()); } } String token = auth.getCredentials().toString(); String header = new String(strategy.encrypt(token.getBytes(), null)); getCredentialsAccessor().setCredentials(event, header); }
throw new UnauthorisedException(event, event.getSession().getSecurityContext(), this);
throw new UnauthorisedException(event, event.getSession().getSecurityContext(), this);
if (userHeader == null) throw new CredentialsNotSetException(event, event.getSession().getSecurityContext(), this);
if (session.getSecurityContext() != null && session.getSecurityContext().getAuthentication() != null) session.getSecurityContext().getAuthentication().setEvent(event);