-
Sep 10th, 2012, 06:25 AM
#1
spring quartz job - accessing spring-security secured bean methods
I added cronjobs to spring app using quartz.
inside these jobs, I would like to access spring-security secured bean methods from another app.
This is my application structure.
| - core
| - webapp
| - jobs-app
both the webapp and jobsapp use core services. jobsapp is not a web application. It just has quartz jobs in it.
Inside a job if I try to access a bean that is secured using SpringSecurity global-method-security I get an exception `{org.springframework.security.AuthenticationCrede ntialsNotFoundException}"org.springframework.secur ity.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext"`
If I set the context using SecurityContextHolder.getContext().setAuthenticati on to a power user, it works.
But, I have to do this for all the jobs.
Is there a way I can make all the jobs runas a particular user? may be some configuration somewhere?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules