Securing REST services in Jersey

前端 未结 5 668
孤城傲影
孤城傲影 2020-12-10 09:13

I am very much new to web services. I have exposed some REST services using Jersey 2 in integration with Spring. Now I need to secure those rest services using authenticatio

5条回答
  •  情书的邮戳
    2020-12-10 09:48

    As the former posts say, you could go with different options, with a varying overhead for implementation. From a practical view, if you're going to start with this and are looking for a comfortable way for a simple implementation, I'd recommend container-based option using BASIC authentication.

    If you use tomcat, you can setup a realm, which is relatively simple to implement. You could use JDBCRealm, which gets you a user and password from specified columns in your database, and configure it via server.xml and web.xml. This will prompt you for credentials automatically, everytime you are trying to access your application. You don't have any application-side implementation to do for that.

提交回复
热议问题