如何将Servlet保留到我的站点(某种身份验证)? [英] How to keep Servlets to my site only (some sort of authentication)?

查看:96
本文介绍了如何将Servlet保留到我的站点(某种身份验证)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,通过servlet向用户发送动态信息。它是无国籍的,没有登录。这个特定的站点使用了从客户端浏览器到服务器的大量doPost()和doGet()调用。

I have a website that sends dynamic information to users via servlets. It is stateless and there are no logins. This specific site uses a decent amount of doPost() and doGet() calls from client browser to server.

我的问题是,如果有人读取我的源代码,他们可以很容易地只是撕掉我面向公众的servlet URL,并在我的Web服务器上花费一个免费的API。

My question is, if someone reads my source, they can easily just rip out my public facing servlet URL's and have a free API at my web servers expense.

如何防止这种情况发生?我是否可以在JavaScript和Java之间使用某种认证包,但不会增加明显的延迟?我只希望我网页上的用户能够调用面向公众的servlet。

How can I keep this from happening? Is there some kind of authentication package I can use between JavaScript and Java that doesn't add noticeable delays? I would only like users on my webpage to be able to call the public facing servlets.

推荐答案

不是专家,但这可能有所帮助: http://oauth.net/ 因为我知道像Twitter这样的大型网络API使用它。

Not an expert but this may help : http://oauth.net/ as I know big web API's like twitter use this.

这篇关于如何将Servlet保留到我的站点(某种身份验证)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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