REST API Security in Java

I am creating a REST API in Java - using Jersey. I want to protect confidential API calls using the API token protection scheme, but I don't know where to start.

Is there any framework that will do this for me out of the box? Or do I need to implement my own security scheme?

+6
source share
2 answers

There are several frameworks for securing Java RESTful web services. I would recommend "Apache Shiro" ( http://shiro.apache.org/ ), it is a very nice and easy to use security infrastructure that will allow you to implement the specified API token security scheme. Take a look at this answer: REST API key generation strategy (where I talked in detail about creating such a solution).

There are other security frameworks that you can use, namely Java EE has security support, and Spring also provides security support. Take a look at this very nice presentation by Matt Riddy where he presents and demonstrates these three frameworks: http://www.slideshare.net/mraible/java-web-application-security-denver-jug-2013

Avoid implementing your “own security scheme" (unless you are an expert on this topic ...), there are many problems that can be missed and lead to problems ... usually these structures are very helpful in preventing that.

NTN.

+9
source

You can take a look at OAuth. Its widespread and there are libraries that will help you implement the protocol.

+1
source

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


All Articles