如何创建和公共使用Web服务,但仍限制其使用只有我的应用程序? [英] How can I create and use a web service in public but still restrict its use to only my app?

查看:163
本文介绍了如何创建和公共使用Web服务,但仍限制其使用只有我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建与创建/更新/删除调用Web服务。但现在我想限制我自己的web应用程序,并没有其他客户使用它。怎样才可以有明文的javascript code,使这些电话,但还是有信心的凭证将不被用于其它地方?

I'm creating a web service with create/update/delete calls. But for now I'd like to restrict use of it on my own web app and no other clients. How can I have clear text javascript code that makes these calls but still be confident the credentials won't be used elsewhere?

我的想法是使用服务器端产生的随机数为每个请求。但我愿意接受你们可能有不同的想法。谢谢你。

My idea is to use server side generated nonces for each request. But I am open to different ideas you guys may have. Thanks.

推荐答案

做你的web应用程序的用户有一个登录ID /密码?如果是,则要求他们登录,并使用标准的会话管理的方法来达到你想要的东西。

Do the users of your web-app have a loginid/password? If yes, then ask them to login, and use standard session management approaches to achieve what you want.

如果您的用户不具有唯一的帐户,而您只需要你的JavaScript code,使Web服务调用 - 那么它的不能来实现。它的琐碎嗅出从JavaScript交通/解压密码。

If your users don't have unique account, and you only want your javascript code to make the web-service calls - then it cannot be achieved. Its trivial to sniff the traffic / extract password from javascript.

这篇关于如何创建和公共使用Web服务,但仍限制其使用只有我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆