I'm creating a simple little (rest)API and now I would like to secure a part of this API with htpasswd (using the oauth library is too much hassle for the simple thing I'm trying to make). Is it possible to only use the .htpasswd file for incoming POST-request and not for GET-requests?

Or is this insecure to begin with (eg. can post-requests be disguised as GET-request)?

Thanks!

有帮助吗?

解决方案

After searching for a while I found the answer somewhere myself. I noticed somewhere that the require valid-user part in the .htaccess file was surrounded by <Limit GET></Limit> and tried changing that to POST. And it worked!

<Limit POST>
require valid-user
</Limit>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top