How to get unique Id for user using ASP.Net Core

I have worked through the okta-aspnetcore-mvc-example and I now want to add user-specific records to my application database. I’m looking at the Claims and expect to find a userId, uid or something that is obviously a unique Id but none of those are included. The possible options are:

  • sub
  • jti
  • idp
  • preferred_username

Which one of these is the unique user Id? Or should I be using another method to get this value?

Hi @liamweston

The claim for the user’s ID is sub. This value is unique and will not conflict with another user.