How to "provide a custom identity provider implementation"?

2,973 views
Skip to first unread message

Melissa Palmer

unread,
Dec 18, 2014, 1:58:13 AM12/18/14
to camunda-...@googlegroups.com
Hi, 

Using Spring container based setup within Tomcat how does one "provide a custom identity provider implementation" as mentioned in [1]. Once custom implementations of ReadOnlyIdentityProvider/WritableIdentityProvider have been written how does one configure the ProcessEngine to actually use these? What's the next step?


Thanks in advance
Melissa

Roman Smirnov

unread,
Dec 18, 2014, 4:30:34 AM12/18/14
to camunda-...@googlegroups.com
Hi Melissa,

Unfortunately I am not so familiar with the identity service, but I think you have to provide your own process engine plugin [1], so that you can extend the configuration of the process engine. The plugin library has to be added to the classloader of the process engine.

As a blueprint you can use the LDAP identity provider [2], which is also a process engine plugin. And in [3] it is described how you can register your provided process engine plugin using Spring XML (the shown example in [3] relies on the LDAP identity provider).

Does it help you?

Cheers,
Roman

Melissa Palmer

unread,
Jan 5, 2015, 5:43:10 AM1/5/15
to camunda-...@googlegroups.com
Thanks Roman, that has helped. I have been able to implement my own ReadOnlyIdentityProvider doing the following: 

1) Create your own Session Factory with 
import org.camunda.bpm.engine.impl.identity.ReadOnlyIdentityProvider;
import org.camunda.bpm.engine.impl.interceptor.Session;
import org.camunda.bpm.engine.impl.interceptor.SessionFactory;

public class MyOwnIdentityProviderFactory implements SessionFactory {
  
  public Class<?> getSessionType() {
    return ReadOnlyIdentityProvider.class;
  }

  public Session openSession() {
    return new MyOwnIdentityProviderSession();
  }

}

2) Create MyOwnIdentityProviderSession which is the class that implements ReadOnlyIdentityProvider and has MyOwn implementations

3) Create your own Plugin as described by Roman 
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin;

public class MyOwnProcessEnginePlugin implements ProcessEnginePlugin {

@Override
public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {

ItdIdentityProviderFactory itdIdentityProviderFactory = new ItdIdentityProviderFactory();
processEngineConfiguration.setIdentityProviderSessionFactory(itdIdentityProviderFactory);
}

@Override
public void postInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
// nothing to do 
}

@Override
public void postProcessEngineBuild(ProcessEngine processEngine) {
// nothing to do 
}

}

4) Ensure that you plugin is configured against the process engine. For example in tomcat update the bpm-platform.xml under conf directory to have the following
<?xml version="1.0" encoding="UTF-8"?>

  <job-executor>
    <job-acquisition name="default" />
  </job-executor>

  <process-engine name="default">
    <job-acquisition>default</job-acquisition>
    <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
    <datasource>java:jdbc/ProcessEngine</datasource>

    <properties>
      <property name="history">full</property>
      <property name="databaseSchemaUpdate">true</property>
      <property name="authorizationEnabled">true</property>

      <property name="mailServerHost">my.mail.server</property>
      <property name="mailServerPort">26</property>
 
      <property name="jobExecutorDeploymentAware">true</property>
    </properties>

    <plugins>
        <plugin> <class>some.package.name.MyOwnProcessEnginePlugin</class> </plugin>


    </plugins> 


  </process-engine>

</bpm-platform>

x...@caravelo.com

unread,
Dec 17, 2015, 4:51:48 AM12/17/15
to camunda BPM users
Hi,

After creating our own identity provider we would like to register it as a plugin programmatically.

https://docs.camunda.org/manual/7.3/guides/user-guide/#process-engine-process-engine-plugins

The documentation says it can be done, however we cannot find any way to do it from the process engine configuration API.

Could you please provide an example of this?

thorben....@camunda.com

unread,
Dec 17, 2015, 5:05:42 AM12/17/15
to camunda BPM users, x...@caravelo.com
Hi,

ProcessEngineConfigurationImpl engineConfiguration = ... // make sure to use Impl
engineConfiguration.getProcessEnginePlugins().add(new YourProcessEnginePlugin());

Cheers,
Thorben

x...@caravelo.com

unread,
Dec 17, 2015, 5:23:51 AM12/17/15
to camunda BPM users, x...@caravelo.com
Thanks !!
Reply all
Reply to author
Forward
0 new messages