Starts in:
1 DAY
22 HRS
11 MIN
37 SEC
Starts in:
1 D
22 H
11 M
37 S
Open Closed

The current user Id is null #3725


User avatar
0
Katherine created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: 6.0.0-rc.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi,

Step 1: obtaining the access token via postman

Step 2: Retrieving (GET) the information with the access token. I am unable to retrieve the current user information. Is there any way to get the Current User Id?

Kindly assist. Thanks


4 Answer(s)
  • User Avatar
    0
    malik.masis created

    Hi, As far as I see your code, you signed your action as [AllowAnonymous] and tries to get the CurrentUser. So you can get null value. Could you check here, please? Regards

  • User Avatar
    0
    Katherine created

    Hi,

    After removing the [AllowAnonymous] command, I received a 401 Unauthorized error. Do I miss any settings?

    Thanks

    <br>

  • User Avatar
    0
    malik.masis created

    Hi,

    It seems you should configure the auth side. Could you follow this guide, please?

    Regards

  • User Avatar
    0
    Katherine created

    Hi,

    I found the answer already. 401 error is caused by missing scope when obtaining the access code via Postman. Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06