Home Authenticate and authorize SOAP, Grails, CXF
Reply: 1

Authenticate and authorize SOAP, Grails, CXF

Gustavo Evovlockas
Gustavo Evovlockas Published in 2018-02-07 21:51:56Z

I'm working on a Grails project that needs to authenticate the user calling my SOAP service.

For the authentication, I'm using CXF and it's working fine, but when I have to authorize using @PreAuthorize with my own implementation of org.springframework.security.access.PermissionEvaluator, the user received by my implementation of PermissionEvaluator is grails.anonymous.user instead of the user authorized by CXF.

How can I get the user authorized by CXF in my implementation of org.springframework.security.access.PermissionEvaluator?

Dennie de Lange
Dennie de Lange Reply to 2018-02-07 22:52:39Z

I think you need to setup the security context in SecurityContextHolder, @see: https://docs.spring.io/spring-security/site/docs/4.2.0.RELEASE/apidocs/org/springframework/security/core/context/SecurityContextHolder.html

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.330253 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO