How do I authenticate user in REST web service?

这一生的挚爱 提交于 2019-12-02 22:05:42
fasseg

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!