My question is whether I can use the Portal (a.k.a. Hub ID) as a unique identifier for someone who connected via oauth to our extension instead of User ID.
yes you can use portal id as a unique identifier .By using portal id as a unique identifer you will create your app portal based which you can share with other users where as if you create your application based on user_id as uniques identifier then you will not be able to share your app between diiferent users by sharing your same portal.
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.