How do I write the method for user authentication in REST web service? I am beginner with web services.
相关问题
- Design RESTful service with multiple ids
- What uses more memory in c++? An 2 ints or 2 funct
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- How to get the maximum of more than 2 numbers in V
相关文章
- Capture method calls in Java
- Securing REST endpoint using spring security
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
- Global Exception Handling in Jersey & Spring?
- REST search interface and the idempotency of GET
- setTimeout() not working called from vueJS method
- Getting error detail from WCF REST
Authentication itself should be done in a stateless way, so that the REST paradigm is not broken. This means authentication has to occur on every request. this SO question might provide some further details
the esiest method is using HTTP-Basic AUTH (rfc2617) over SSL encrypted connections (https). here are some java examples:
another method is using nonces so that you dont have to resend the user/pass combo everytime, but they are a bit more challenging:
there are lots and lots of ways to authenticate users but these 2 are the most often used that dont hold session state on the server side.
hope that helped