Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
951 views
in Technique[技术] by (71.8m points)

Http请求鉴权流程问题

web服务鉴权流程问题。

请求url /update时,请求头里面有uid和token,去做了鉴权。
但是请求post body的参数也有uid,这个uid会做更新用户信息的条件。

现在怕被修改请求参数里的uid,因为这样会用本人的uid token来做了鉴权,然后修改了别人的信息。

这种情况,你们会用请求头的uid来做更新用户信息的条件吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

1.token中已包含uid,无需在header里再加一次。
2.是否能修改别人的信息,这和鉴权无关,这是业务代码的逻辑。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...