Rest token authentication with HTTP header

前端 未结 2 742
终归单人心
终归单人心 2021-01-06 16:58

This is an existing system with a login screen, now I expose some services as REST service. I build an authentication-token login system for this Rest(jersey) service. User

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-06 17:13

    1. I would typically pass the token in an HTTP header.

    2. Whether you use POST or PUT shouldn't matter.

    3. Something else I would suggest to help prevent replay type attacks would be to include a nonce (ever increasing value) with each POST request. The server would then track the last used nonce and prevent any requests that use a previously used nonce from executing.

提交回复
热议问题