0

我正在使用带有应用程序的asp.netWeb 服务和来自.AndroidselectinsertMS-SQL Server

我只想通过我的 Android 应用程序访问 Web 服务。

因为,网络服务托管在我的私人服务器上,数据非常安全。我不希望任何人都可以调用我的网络服务。

有什么解决办法吗?

4

3 回答 3

1

在请求中POST提出请求并使用额外字段来检查发件人。在此字段中,您可以使用任何密钥!

于 2013-07-25T08:34:33.727 回答
0

there are a few ways to do this (in my opinion):

  1. if your app has user account involved, you can simply use user session to authenticate or the social logins eg. facebook
  2. post request, with a header of a hashed key,

good read: https://weblogs.java.net/blog/gmurray71/archive/2006/08/restricting_acc.html

于 2013-07-25T09:11:23.450 回答
0

在您的请求中,只需输入一个 SHA-1 密钥(例如SHA1(Hard_coded_password_in_app_and_WS, unique_ID_stored_in_preference_and_in_data__base)

在您的 WS 中,只需检查此参数是否正常,然后回答。这不是有史以来最好的安全性,但它很容易设置,并且可以解决问题。

于 2013-07-25T08:54:50.173 回答