@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);
  }