I was able to successfully integrate Spring Security with Camunda IdentityService . My goal is to share a common authentication area between them, because we have a spring-boot web application in which camunda also runs. In our Spring application, Security must exclusively control single-mode auth, acting as a read-only Camunda client.
We plan to associate business processes with users, and these users must authenticate from Spring Security.
My question is, what should I exactly implement / override?
My current code is as follows:
import org.camunda.bpm.engine.impl.identity.db.DbReadOnlyIdentityServiceProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
@Component
public class SpringSecurityReadOnlyIdentityServiceProvider extends DbReadOnlyIdentityServiceProvider {
@Autowired
private AuthenticationManager authenticationManager;
@Override
public boolean checkPassword(String userId, String password) {
try {
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(userId, password));
} catch (AuthenticationException e) {
return false;
}
return true;
}
}
( ), , .
Spring . ?
. , , ReadOnlyIdentityProvider WritableIdentityProvider, , . DbReadOnlyIdentityServiceProvider.
!