title: Custom Security Plugin for Apache Ignite
body: <p>I am trying to use Apache Ignite as in-memory database.<br>
  To enable the security, I created own security plugin by following link   <a href="http://smartkey.co.uk/development/securing-an-apache-ignite-cluster/" rel="nofollow noreferrer">http://smartkey.co.uk/development/securing-an-apache-ignite-cluster/</a> </p>
  
  <h2>Below are my implementation details</h2>
  
  <pre><code>public class IgniteSecurityConfiguration implements PluginConfiguration{
          public class&lt;? extends PluginProvider&gt; providerClass(){
            return IgniteSecurityProvider.class;
          }
      }
  public class IgniteSecurityProvider implements PluginProvider{
      @Override
      public IgnitePlugin plugin(){
        return new CASCachePlugin();
      }
  } 
  
      public Object createComponent(PluginContext pluginContext, Class aClass){
         if(aClass.isAssignableFrom(GridSecuriytProcessor.class)){
         return new PasswordSecurityProcessor();
      } else {return null;}
     }
  
  public class PasswordSecurityProcessor implements GridSecurityProcessor,IgnitePlugin
  {
  @Override
  public SecurityContext authenticateNode(ClusterNode clusterNode, SecurityCredentials securityCredentials){
     return new SecurityContext(){
           public SecuritySubject subject(){
             return new SecuritySubjext(){
               //implement methods
             };
           }
          //other implementation methods
      };
  }
  </code></pre>
  
  <p>getting exception when I am starting ignite using examples/config/example-ignite.xml</p>
  
  <blockquote>
    <p>Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start SPI: TcpDiscoverySpi<br>
    at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi (GridManagerAdapter.java:300)<br>
    ...<br>
    ...<br>
    Caused by: class org.apache.ignite.spi.IgniteSpiException: Failed to authenticate local node( will shutdown local node).<br>
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.localAuthentication(ServerImpl.java:975)<br>
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:863)<br>
    .....<br>
    Cuased by class org.apache.ignite.IgniteCheckedException: Failed to serialize objext: com.x.x.x.PasswordSecurityProcessor<br>
    at org.apache.ignite.marshaller.jdk.JdkMarshller.marshl0(JDkMarahsller.java:85)  </p>
  </blockquote>
  
  <p><strong>Any idea on what I am missing?</strong>
  Tried the PasswordSecurityProcessor class to implement Serializable but still it did not help.</p>