Authentication and authorization in Spring Data REST -
i implementing spring data rest based app , know if there elegant way implement authentication , authorization rules using framework or related frameworks.
all http requests rest server must carry authentication headers, need check them , decide authorize or not based on http method , association of authenticated user resource being requested. example, (the app rest server of e-learning system), instructors can access own course sections, students can access courses sections subscribed, etc.
i know if there default way implement authorization in spring data rest. if answer no, make suggestion issue? thinking about:
- servlet filters
- spring security
- spring data rest handlers (how access http headers?)
the best bet spring security. achieve authorization simpler manner.
spring security require implementation looks @ request headers , performs log-in operation programmatically.
refer accepted answer here.. had followed same , implemented security layer in front of rest services ( build using resteasy )
restful authentication via spring
there alternate method well.. refer http://www.baeldung.com/spring-security-authentication-provider
in both cases can disable session creation declaring stateless authentication in spring security, improve performance considerably when large volume of hits made state-less rest services..
Comments
Post a Comment