Open Closed

How to get the current logged in user info? #9289


0
dzungle created

Hello Support Team,

I am using aspnetzero asp.net core version 8.9.2. I want to get the current userId using AbpSession.UserId, but it null. Please, see the image below:

I see there's an other way (from abp site) that uses AbpSession.ToUserIdentifier(). But I cannot find this extension method.

Please, help me. Urgently

Thank you in advance


3 Answer(s)
  • 0
    maliming created
    Support Team

    hi

    Are you using MVC or angular? Does your method require authentication and authorized to call?

    Please share some code.

    I see there's an other way (from abp site) that uses AbpSession.ToUserIdentifier(). But I cannot find this extension method.

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/e0ded5d8702f389aa1f5947d3446f16aec845287/src/Abp/Runtime/Session/AbpSessionExtensions.cs#L46

  • 0
    dzungle created

    Hello Mailiming,

    I am using angular. In the frontend, I use the Syncfusion FileUpload component which needs to set an API for save action as following:

    The file is uploaded successfully, but in the same method I cannot get the current user. Here is my code:

    Thank you for quick reply

  • 0
    musa.demir created
    Support Team

    Can you please share your angular part of code which cause you to not get current user info?