Knowing which account a redirect originates from (specifically after OAuth)

I am working in an ASP MVC environment. Been able to authenticate, and fetch data. The issue is, when the redirect/callback happens, how do I know which hubspot user it came from?

So, for instance, I grant access to our app and the redirect takes me back to one of our pages. Is there anything in that redirect to say "hey, blah@test.com" just granted access?

I see I can leave the redirect blank, and on the initial set up, I can add params, but leaving that blank probably isnt overly useful. If I put a value in, as I have seen in other posts, dynamic params are not allowed.

Getting up and running was really easy, but not sure how I handle managing tokens if I don’t know who to associate them with. Would also need this for any redirect outside of authentication, so i know which datasets to update, etc…

Hopefully I am just missing something

Thanks

Hi @strovatore ,
When you authenticate the user , you always get the portal id and email after hitting callback url from refresh token .From there you can save the values inside your database and know which user has installed the app in which 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.

Thanks for the fast reply! I will give that a shot. If it works I will mark as a solution

Ok, I got it to work. I think I was just a little surprised there wasnt info returned for this on the post call to ../token. After the post, I passed the token to a get call to ../access-tokens and that gave me what I needed. Is what you meant, or did I go a different route than you were suggesting? Thanks again for the help!