abp
abp copied to clipboard
IdentityServer CurrentUser is null
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
Upgrade ABP from 7.2.2 to 8.0.0 , get api /api/abp/application-configuration
current user is null
"currentUser": {
"isAuthenticated": false,
"id": null,
"tenantId": null,
"impersonatorUserId": null,
"impersonatorTenantId": null,
"impersonatorUserName": null,
"impersonatorTenantName": null,
"userName": "admin",
"name": null,
"surName": null,
"email": null,
"emailVerified": false,
"phoneNumber": null,
"phoneNumberVerified": false,
"roles": []
},
Reproduction Steps
No response
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
8.0.0-rc.1~8.0.0
User Interface
Common (Default)
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Windows (Default)
Other information
No response
Try print claim type
var claims = _currentPrincipalAccessor.Principal.Claims.ToList();
foreach (var claim in claims)
{
Logger.LogInformation("Type:{Type},Value:{Value}", claim.Type, claim.Value);
}
7.2.2 Claims
8.0.0 Claims
Facing the same issue in on 7.4.1
<TargetFramework>net7.0</TargetFramework>
Facing the same issue in on 7.4.1
<TargetFramework>net7.0</TargetFramework>
I also encountered it. How to solve it?
I also encountered it. How to solve it?
I have the same problem. ABP version 8.0.5, net8.0. I noticed that this depends on the Microsoft.AspNetCore.Authentication.JwtBearer
package. If you use 7.0.17
everything works as before, if 8.0.3
then the CurrentUser is empty.
See https://github.com/abpframework/abp/issues/18895#issuecomment-1993588224
Hello @maliming this solution you mentioned here works fine If I am using EfCore For MSSQL
but it still return
"currentUser": {
"isAuthenticated": false,
"id": null,
"tenantId": null,
"impersonatorUserId": null,
"impersonatorTenantId": null,
"impersonatorUserName": null,
"impersonatorTenantName": null,
"userName": "admin",
"name": null,
"surName": null,
"email": null,
"emailVerified": false,
"phoneNumber": null,
"phoneNumberVerified": false,
"roles": []
},
When I use EfCore For PostgreSQL
Version of Abp 8.0.5
hi @YoussefRashed
Can you share a simple project?
@maliming Thanks For your Attention ❤️ But Sorry it Works
! I missed this Line on my PostgresHostModule
options.MapInboundClaims = false;