Spring Security-Reload my security.xml on edit - spring

I am using Spring Security in my project. I have a situation where I need to change the pattern attribute in itercept-url tag on runtime. For this I have to again restart the tomcat server and in turn takes a lot of time for me to test my changes.
Does Spring have a solution where the security.xml file is reloaded when I edit it in my web application, without restarting my server. Please provide some pointers for the same as I am new to Spring Framework.
Any link to a step by step tutorial will certainly help a lot.
Thanks in advance.
Divyang Agrawal

Use spring annotation rather than using xml configuration. so by using annotation you do not required tomcat restart after changing the source code.
you can find simple tutorial for how to use annotation based spring security here Link

Related

Azure Active Directory in Spring App Without Boot

I have been trying to set up a Spring Web application to use Azure Active Directory.
All the samples that I have found online are based on Spring Boot, is there a simple example that shows setting up spring framework web app only without using Spring Boot?
I am having no luck finding stuff, I am also trying to figure out how to convert all the spring boot autoconfig. Surely there is a sample somewhere that makes it easy to use for a Spring Framework only web-app?
I was able to figure this out somewhat. I'm very new to OAuth so still trying to learn as I go.
Basically I followed the Spring Reference and got things working using the override auto-configuration sections at https://docs.spring.io/spring-security/reference/servlet/oauth2/index.html
It also helped that I updated the Spring Framework versions to the latest and made sure I used the correct dependencies according to that reference site

Spring Boot Runtime Property Changes After Deploying Start of Application

I came across a requirement of switch on/off case in Spring Boot Application. We have a notification service implemented which is working on property :
notifyall = true in application.properties file.
Now I want to stop the notification services by specifying notifyall = false in application.properties file without any downtime.
Is it possible in Spring Boot Application?
If yes, then any step wise approach or relevant tutorial will be of great help.
Thanks
Use spring boot actuators.
Please go through the following link: https://projects.spring.io/spring-cloud/spring-cloud.html#_environment_changes
it mentions #ConfigurationProperties with prefix; any change in the configuration will be loaded automatically.

Spring boot + Activiti explorer

Is it possible to integrate activiti explorer maven plugin with activiti Spring boot app?, so that we can make use of activit-explorer to view deployed process in activit-spring boot engine.
I know we can use rest-api over spring boot to query process engine, but I want to know if it is possible to run the explorer over spring boot by adding it as a maven plugin during deployment?Or can we tweak the activit-explorer.war somehow to point to spring-boot activiti engine?
activiti-explorer.war is standalone webapp by itself. I've write some guideline on how to manually to embed activiti-explorer to you own app. http://blog.canang.com.my/2016/05/12/embedding-activiti-explorer-to-your-application/
Most probably step 5 in my blog is your solution.
btw, there's reason why the name is 'default'. I can't recall it atm
I thought of answering my own question so that it will be useful for other developers with similar requirement. If you want to make an eco-system where activiti-rest, explorer and your custom end points co-exist, please refer this thread from activit forum. I have tried this and is working fine. link to thread
I would like to give my observation here. In order to avoid getting into pulling source and trying to build myself, I achieved partial success, by installing the activit-explorer as part of the usual standalone installation.Started the standalone activiti-explorer using Apache-Tomcat but I configured the database for Activiti as same as (MYSQL in my case) I used in my spring-boot application to hit the common ground.
But apparently the activiti version in my spring boot app was 5.19.0.0 and that for activiti-explorer was 5.22.0.0, which created some misalignment for spring boot application startup to fail. I am hopeful that with matching versions it might succeed. When I get some more time on me I will try and update. Since then may be someone can use this route.

Spring Security Namespace

I am new to Spring Security and I was trying to add spring security namespace. Do I need to add this to serverlet-context.xml. In my Eclipse>Spring MVC project it looks like that is the only file that has namespace information. The other two xml files are web.xml & root-context.xml.
Where do I put the namespace information?
It will depend on how your app is split up and what you want to secure. The web.xml file is not a spring configuration file so you can't put Spring Security configuration in there. Putting it in the servlet-context.xml should be OK.
However, if you are at this stage, you should probably start with one of the sample applications. Also take a look at this getting started guide on spring.io which uses Java configuration with Spring Boot which is a much nicer combination.

Spring Security without spring core?

I have a really simple question, that I just can't find the answer.
If I want to use only Spring Security, do I need Spring core or any other dependency?
In this link, in the bottom I see only spring security jars as dependencies, but still I couldn't get it to work. I only got it to work when I used a lot more of spring jars (core, context, and more).
So, what are the minimal dependencies I need for using Spring Security? All I need is an authorization and authentication framework, and I want as little dependencies as possible.
Thank you!
For every spring extension you need to use Srping core, because every extension is build on top of spring core

Resources