使用UDID创建唯一的用户身份 [英] Using UDID to create unique user identity

查看:125
本文介绍了使用UDID创建唯一的用户身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个与服务器通信以存储和交换数据的iPhone应用程序。由于我希望尽可能简单,我想避免为用户帐户注册(或mybe也使用密码)。是否可以(并允许?)获取iPhone设备的UDID并制作例如。它的MD5哈希值,我转移到服务器并用它进行身份验证?由于此ID是唯一的,我可以简单地使用它来登录并从服务器获取用户指定的数据,而无需创建登录数据。

I am working on an iPhone App which communicates with a Server to store and exchange data. Since I would like to make it as simple as possible, I want to avoid registration (or mybe also the using of a password) for the user account. Is it possible (and allowed?) to get the UDID of the iPhone device and make eg. an MD5-hash of it, which I transfer to the server and use it for authentification? Since this ID is unique I could simply use it to login and get the user specified data from the server, without any need of creating login data.

是否允许访问UDID,对其进行MD5哈希并将其存储在数据库中?

Is it allowed to access the UDID, make an MD5-hash of it and store it in a database?

第二个问题是:如何获取UDID? ; - )

Second question is: how do I get the UDID? ;-)

推荐答案

是的,这是允许的,但请从文档中考虑我在下面报告的内容。

Yes, it's allowed, but take into account what I have reported below, from the documentation.

您可以按如下方式检索UDID:

You can retrieve the UDID as follows:

NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

请注意Apple官方文档中的以下内容:

Note the following from the offical Apple's documentation:

设备的唯一标识符(有时缩写为唯一设备标识符的UDID)是由各种硬件标识符(例如设备序列号)组成的哈希值。保证每个设备都是唯一的。 UDID独立于设备名称。对于使用SIM(用户识别模块)卡的设备,UDID独立于SIM卡。

A device’s unique identifier (sometimes abbreviated as UDID for Unique Device Identifier) is a hash value composed from various hardware identifiers such as the device serial number. It is guaranteed to be unique for each device. The UDID is independent of the device name. For devices that use a SIM (subscriber identity module) card, the UDID is independent of the SIM card.

为了用户安全和隐私,您不得公开关联设备的具有用户帐户的唯一标识符。

For user security and privacy, you must not publicly associate a device’s unique identifier with a user account.

您可以将UDID与特定于应用程序的用户ID结合使用,以识别服务器上的特定于应用程序的数据。例如,您可以使用设备用户组合ID来控制对已注册产品的访问,或者在中央服务器中存储游戏的高分。但是,如果您正在开发游戏,则可能需要使用游戏套件编程指南中所述的Game Center玩家标识符键。

You may use the UDID, in conjunction with an application-specific user ID, for identifying application-specific data on your server. For example, you use could a device-user combination ID to control access to registered products or when storing high scores for a game in a central server. However, if you are developing a game, you may want to instead use Game Center’s player identifier key as explained in Game Kit Programming Guide.

重要提示:永远不要存储基于用户信息的用户信息仅限UDID。始终使用UDID和特定于应用程序的用户ID的组合。组合ID可确保如果用户将设备传递给其他用户,则新用户将无法访问原始用户的数据。

Important: Never store user information based solely on the UDID. Always use a combination of UDID and application-specific user ID. A combined ID ensures that if a user passes a device on to another user, the new user will not have access to the original user’s data.

这篇关于使用UDID创建唯一的用户身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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