What is a good combination of tools currently used to implement REST / J2EE / Database + custom auth

It was just interesting at what point in time, what is a good combination of tools / frameworks / libraries for implementing the REST API on top of J2EE, which integrates with RDB backend and uses OpenID for authentication.

I want to implement a server component that provides a set of services, all of which will use OpenID authentication, and the services will receive or update information to / from the relational database environment.

I am interested in:

* application server options available (eg Tomcat, Glassfish etc.) * IDE (eg Eclipse, Netbeans, IntelliJ etc.) * additional components useful for implementing REST (and JSON payloads) * what is best practice/good technique/options available for database integration from the services (hibernate via spring, hibernate directly, raw jdbc connections ... ) * for integrating authentication via OpenID - what is an appropriate integration point for any custom authentication mechanism within the J2EE environment - are there any commonly used solutions/plug-ins available for OpenId etc. 

Also any pointers to good, current textbooks, books, etc.


Edit: Unfortunately, I did not have as much time to research the results of this question as I would like.

At this point, I found that installing / configuring REST with Jersey was very fast, and I believe that I can use ContainerRequestFilter to support OpenID according to this article here: http://plaincode.blogspot.com/2011/07/openid -authentication-example-in-jersey.html

I intend to use OpenId4Java to support OpenId, with PAPE extensions to return email to users. I do not need OAuth, since I do not need to contact other users with other OpenID information or information on their OpenID site from my server application.

I looked at the last Spring, it looks very good, and if I needed to create a web client with my solution or if I had more time to look at both, I could easily end here.

Thanks for the good answers and answers, it is difficult to choose the right answer. I accepted the answer yves because it is correct and the way I am going at the moment with minimal time for proper research, but with the award-winning cfontes, since it is also correct, and he answered with additional information and justification.

+6
source share
3 answers

Make it simple and modern (Spring is neither one nor the other for RESTful web services):

Look at this project on GitHub , it produces JSON from static data. Its web.xml and ProductResource are good places to start.

  • Each server will do the job, Jetty is my favorite, Tomcat , standard
  • The choice of IDE is up to you, the 3 that you give are excellent, well integrated with Maven and source management tools. I use Eclipse out of habit
+6
source

I would go for

  • Spring 3: this may be useful for communication with Dependency injection and other things.
  • Spring MVC: support and query matching support based on queries that works very well with Spring
  • Apache Tiles: To simplify the creation of HTML templates.
  • Spring Security: this is a JAAS implementation, and for me it is better and simpler than standard JAAS (no full web server needed, tomcat will do everything)

This can help you decide which resident provider you want: Persistence provider comparison. I would go for Hibernate because it has a lot of great features, such as criteria API, Search hibernation and is widely used.

Of course, your application should use JPA 2 for interchangeability, instead of directly using the Persistence provider (this is not easy for one of the other, but with JPA2 it is possible, there should also be a lot of trouble, but it is possible)

+6
source

I would go with NetBeans 7.0.1 and GlassFish as described here

From a related tutorial:

The IDE supports the rapid development of RESTful web services using JSR 311, the Java API for RESTful Web Services (JAX-RS) and Jersey, the reference implementation for JAX-RS.

I would use GlassFish JDBC Realm for authentication (see this tutorial ), but I have never worked with OpenID, so I don’t know if this approach can be used with OpenID.

0
source

Source: https://habr.com/ru/post/900997/


All Articles