Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Get Identity User Id in the service which called by Web API #66


User avatar
0
daniel hussy created

Hi Everybody!

My question is how can i get the user ID in my service which called from javascript via Web API? I need user ID for my Entity which has "string SendedById" property.

I have two separated database, the Boilerplate FW uses the first and the Identity FW uses the second. I don't want module Zero yet.

Where can i pass UserId to the Web API service?

Please help me!


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    If you're using some authentication mechanism, then you can get current user id. For example, using Current Principal.

    If you want to integrate this Id with rest of ABP, then you should implement IAbpSession interface.

    While not published yet, you can see documentation here: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/doc/WebSiteContents/abp-session.html">https://github.com/aspnetboilerplate/as ... ssion.html</a>