3 ms·
You will need two things: One, a human facing unique id (or 'nickname') -- such as palakz -- which you can use in your HI and whatnot. This one could even chan
by mindcrash 10y ago
You will need two things:
One, a human facing unique id (or 'nickname') -- such as palakz -- which you can use in your HI and whatnot. This one could even change over time.
Two, a computer facing unique id (or 'subject') which uniquely identifies the person in your application, usually a guid, long integer or whatnot. This one never changes.
Then combine the two and put them either in a secure (encrypted) cookie (for your web app) or token (for your mobile app) and you are basically done.
This for example is how authentication on Twitter works. Every person on Twitter has a unique id (probably designated through Snowflake mentioned below) and a self chosen name (which you can also change if I remember correctly). The former is stored in a secure cookie (in the web app) or a token (in the mobile app) together with some other static user information (e.g. nickname). When visiting a page requiring authentication the id is exposed to the backend code so it can recognize who you are and for example decide what actions to take (e.g. take you to the onboarding page or your personal timeline)
Hope this helps :)
- snowwrestler 10y agoLooking at Twitter is a good way to anticipate some edge cases. For example, think about identity from a social perspective. On Twitter, identity is defined not just by the "@handle", but by the name and avatar image as well. Changing the name or avatar has little consequence in Twitter's platform, so some users do that a lot to play with their identity. BTW, playing with identity--defining it, testing new attributes, evolving it over time--is a MAJOR attraction of social networks, if not the main reason anyone uses social networks at all. If your platform attempts to treat identity purely as a fixed thing, you're going to have trouble with long-term engagement. You need to give users identifying attributes that they can easily change regularly. Speaking of which--while Twitter users can change their @username, it breaks all previous conversations. Why? Because Twitter manages conversational references solely by the text of the tweet. So if you change your @username to @newname, all those @username references in old conversations will go black (i.e. not be linked anymore). I believe it also releases your old @username for someone else to register! So, it seems quite uncommon for folks to change their @usernames on Twitter. In fact the few people and orgs I know who wanted a new ID on Twitter just started a new account and then used their old account to tell their followers to follow the new one. That way old conversations stay linked and in control. And it's a sort of follow "list cleaning" in that only the most engaged folks follow you to the new account.