spring security configuration for jax-rs RESTfull services - java

I have some JAX-RS *RESTfull* application with Spring(JDBC,injections and AOP).
I am trying to configure my application with Spring Security (authorization/authentication and users management).
Have you any examples with good explanations how to config Spring Security with JAX-RS?
Sorry for my poor english...
Thanks.

check the following article on the topic :
Configuring Spring Security for a RESTful Web Services

Related

Spring and Jboss SAML Integration

Is it possible to configure my spring application (which runs on tomcat) as service provider in SAML integration, where identity provider is configured on jboss 7 server? We have several subsystems, integrated via picketlink and now I am struggling to integrate my spring application with them.
I wonder if you have some examples / tutorials on how such integration can be implemented.
Spring Security has a SAML extentions spring-security-saml There is also a sample included.

Can we use Java Spring mvc and Spring Boot at the same time in a project?

Actually I want to implement JWT authentication in existing Spring based project. But all the examples and helping material i found, are in Spring Boot.
Kindly provide any relevant link which helps me in implementing JWT auth or guide me if we use Spring Boot together.
Thanks in advance.
no you can't,
here's an example spring security jwt with spring mvc
https://www.toptal.com/java/rest-security-with-jwt-spring-security-and-java?

Saml with spring 2.5.6

I am newbee with SAMLv2 and I need to integrate it on my webapp (acting like SP) running under spring 2.5.6.
All sample i could see are using spring 3 at minima, do you have example under spring 2.5.6 ?
I can't (due to time issue) migrate my SP to spring 3, any help would be very appreciated...
Thx
There are several resources that you can use as references:
Spring Security SAML Extension
Spring SAML Extension allows seamless inclusion of SAML 2.0 Service Provider capabilities in Spring applications. All products supporting SAML 2.0 in Identity Provider mode (e.g. ADFS 2.0, Shibboleth, OpenAM/OpenSSO, Ping Federate, Okta) can be used to connect with Spring SAML Extension.
Link: http://projects.spring.io/spring-security-saml/
Spring Boot-based sample Service Provider by using Spring Security SAML extension
Currently Spring Security SAML module doesn't provide a starter for Spring Boot. Moreover, its configuration is XML-based as of this writing. The aim of this project is to explain how to develop a Service Provider (SP) which uses Spring Boot (1.4.0.RELEASE) and Spring Security SAML Extension (1.0.2.RELEASE), by defining an annotation-based configuration (Java Configuration). Thymeleaf is also used as template engine.
Link:
https://github.com/vdenotaris/spring-boot-security-saml-sample
This project represents a complete implementation example of a SAML 2.0 Service Provider in Spring.

Spring Boot + Spring Security Restful Login

How would I go about securing a spring boot web service with spring security using java configurations and not xml? I need this to be a pseudo-RESTful service that returns a 401 response code on failed authentication and does not involve a custom login page. On a successful authentication, JSESSIONID should be returned and subsequently sent with every request.
Can someone provide a coded example of how to do this as I am completely lost? The Spring guides (for whatever reason) do not cover anything like this for spring boot secured with spring security.
THANK YOU!
Have you read through Dave Syer's blog posts on securing spring boot web apps? He's got a great 5-part post on this subject:
SSO with OAuth2: Angular JS and Spring Security Part V
http://spring.io/blog/2015/02/03/sso-with-oauth2-angular-js-and-spring-security-part-v

Best approach for securing REST services and a web application

I´m building a web application which comunicates server and clients through REST services (I´m planning to build a mobile app in mid term).
I´ve used Spring Security in other web applications without REST services. But I´m not sure if that approach is suitable for my scenario.
Is it possible secure both access to web pages and calls to REST services using Spring Security? What would you recommend?
Backend uses Spring Data + Spring MVC.
Thank you.
Yes, Spring Security is a good way to secure both REST endpoints and traditional MVC webpages. The implementation can be similar for both your REST endpoints and MVC routes depending on your requirements.
Spring Security is a popular and effective way to add security to your Spring application. Since you already have experience with it, you should be able to secure your REST endpoints with relative ease.
Check out this detailed tutorial on securing REST routes with Spring Security to get started: https://spring.io/guides/tutorials/rest/5/

Categories