cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Activiti Spring REST API Basic Authentication

pavan496
Champ in-the-making
Champ in-the-making
We included activiti-rest api in our Spring boot application as a maven dependency.


<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter-rest-api</artifactId>
<version>5.17.0</version>
</dependency>


We already have security configuration present in our application and we would like to use the same for security activiti's rest services as well. I have tried to search around the internet but couldn't find a direct way to disable activiti's authentication configuration.

What is happening right now is, all services of our application are processed by activiti's basic authentication set up. Is there any way we can achieve this?
8 REPLIES 8

vasile_dirla
Star Contributor
Star Contributor
Hey,
did you try to skip Activiti security autoconfiguration?

<code>
@EnableAutoConfiguration(exclude = {
             org.activiti.spring.boot.SecurityAutoConfiguration.class
    })
</code>

I didn't test it yet. (it's just theory) .
http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-auto-configuration.html

Will be nice if you could provide a sample application to show this behaviour and then the community will have some source code to play with.

amir68
Champ in-the-making
Champ in-the-making
I test it. Not worked for me.
please help us in other way!

evilsun
Champ in-the-making
Champ in-the-making
Hi, i ve managed to disable activitis spring security (we are using shiro) by excluding 4 classes :
<java>
@EnableAutoConfiguration(exclude = {
        org.activiti.spring.boot.RestApiAutoConfiguration.class,
        org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
        org.activiti.spring.boot.SecurityAutoConfiguration.class,
        org.springframework.boot.actuate.autoconfigure.ManagementSecurityAutoConfiguration.class})
</java>

and overriding RestApiAutoConfiguration  class - removed SecurityConfiguration conf class.

vickysirwani
Champ in-the-making
Champ in-the-making
I tried the above. Not working. Can you share sample code?

supersun
Champ in-the-making
Champ in-the-making
This might be coming late but for anybody that wants to try, this worked for me in <activiti.version>5.19.0.1</activiti.version>

@EnableAutoConfiguration(exclude = {
        org.activiti.spring.boot.RestApiAutoConfiguration.class,
        org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
        org.activiti.spring.boot.SecurityAutoConfiguration.class,
        org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration.class
})

jbarrez
Star Contributor
Star Contributor
Thanks for posting this, @supersun. I' m sure it'll help many people!

chriszhang
Champ in-the-making
Champ in-the-making
If do disable like this,user my custom security 4 will thow exception,How can I custom my security4  with activiti.

sayantan_sinha
Champ on-the-rise
Champ on-the-rise

I believe this might be pretty late, but for me the below worked. I am using Spring Boot 1.5.2.RELEASE and activiti 5.22.0 and activiti-rest 5.17.0.

@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
org.activiti.spring.boot.SecurityAutoConfiguration.class,
org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration.class })

supersun _‌ Thanks for the pointer, but if I had org.activiti.spring.boot.RestApiAutoConfiguration.class added to this, then none of the REST APIs were exposed, so that need to be taken out from the exclusion list.

Hope this helps people having similar issues.