I'm building an app where I want to be able to uniquely identify a user, in a similar manner as how I can use a List GUID to identify a list or listItem.
There are a multitude of values that exist in the CurrentUser context. I'm just now sure which one would be wholly unique, Below is sample data
CurrentUser.ID - 1
CurrentUser.LoginName - i:0#.f|membership|matt@somewhere.onmicrosoft.com
CurrentUser.UserId.NameId - 12345abc678de90f
The NameId seemed like a good candidate based what I read (http://msdn.microsoft.com/en-us/library/fp179932.aspx) but I just want to be sure. LoginName could work but I can forsee issue if a user or system is ever able to change an e-mail, would that change the loginName? Finally ID just doesn't seem right based on how every other elements exists with a GUID to identify it.
Any insight would be appreciated, thanks.
Matt