用户认证前的安全 Rest-Service [英] Secure Rest-Service before user authentification

查看:33
本文介绍了用户认证前的安全 Rest-Service的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个提供多种休息服务的 Web 应用程序(泽西岛).大多数端点都通过 BASIC 身份验证进行保护.此外,我使用 SSL 进行传输,并为每次调用请求 POST.客户/消费者是安卓应用程序.

I have a web application that provides several rest services (Jersey). Most of the endpoints are secured by BASIC authentification. Further more I use SSL for transport and demand POSTs for every call. The clients/consumers are android apps.

到目前为止一切顺利.唯一容易受到攻击的服务是注册.这是要调用的第一个"服务,而且用户还不存在.所以我不能使用 OAuth 等.我还必须保持端点易于访问以允许用户注册.

So far so good. The only service that seems to be vulnerable is the registration. It's the 'first' service to call and a user does not exist yet. So I cannot use OAuth, etc. I also have to keep the endpoint easy accessible to enable the user to regster.

我如何保护此服务的安全,使其不会被充斥我的数据库的机器人发送垃圾邮件?

How do I secure this service, so it's not spammed by a bot flooding my database?

推荐答案

这些怎么样?

  1. 在请求参数中使用带有令牌的注册链接.确保令牌在某个时间后过期.您也可以为客户端创建令牌端点 URL 以获取有效令牌.
  2. 在您的请求中使用自定义标头或动态自定义标头.此外,您可以检查动态自定义标头以验证请求的真实性.
  3. 在注册完成后立即使用注册确认工作流程,例如电子邮件/文本验证.每天运行一个流程以删除任何在 x 天内未验证的用户帐户.

我认为您无法真正以 HTTP 方式保护注册 URL.恕我直言,任何拥有注册网址的人都可以成为尝试注册的正确人选.所以如果你问我,选项 3 比其他选项更好.

I do not think you can really secure the registration URL in a HTTP way. IMHO, anyone who has the registration url can be a right guy trying to register. So if you ask me, option 3 is better than others.

这篇关于用户认证前的安全 Rest-Service的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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