How to authorize system calls in spring security

java, security, spring, spring-security

Solution

The simplest way would be to partition the application into an “internal” set of beans that just implement the methods, and an “external” set of beans that present the “internal” operations to the web. The security annotations can go on the “external” beans, and the JMX/Quartz-driven access be performed directly on the “internal” beans (or suitable other delegates).

Problem

I implemented spring security in my web application. Now all my services are secured and can be only invoked by authorized users. Everything works on webside, but if I invoke method via JMX or by quartz spring throw exception "Access denied". Now I created "fake" user and I log him at jmx method start, but I dont think its good solution. How I should do it ?

Original source