Search code examples
azure-ad-msalpassport-azure-ad

What ID can I use for the signed in user using passport-azure-ad?


I am adding Microsoft Account authentication to my web application. We need to store extra information about the signed in user to a DB. What id can I use for the user to associate this data with? I am assuming it is either the oid, tid, or sub.


Solution

  • You should use the user account OID or a combination of that and another property as its OID is globally unique.