- ABP Framework version: v4.4.3
- UI type: MVC
- DB provider: EF Core
- Module Template: yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hello ABP,
I have created a new solution with version of 4.4.3 like described in your documentation.
abp new Acme.IssueManagement -t module-pro -v 4.4.3
I have used CurrentUser.UserName on SampleAppService which comes from default template for taking the username. I saw the username was null. Other values were fine.
If I try on developer tools by using "abp.currentUser", I can see the username.
I have faced this issue on my application and I wanted to be sure whether the cause of the problem was related with me or not. Is that kind a bug or am I missing somethings?
Thanks.
4 Answer(s)
-
0
-
0
Have you tried on Web.Unified which is Single (Unified) Application Scenario? When I runned identity, web.host and http.host separately (which is Separated Deployment & Databases Scenario), I got that problem. Web.Unified works properly.
-
0
Hello @uyarbtrlp
Yes, I've reproduced that strange problem.
It looks like we have missing configuration related with identity claims in our
module-pro
template.This is only development time problem of course, when you test it with normal application it will work without problem. (not host appilations in your module solution)
Thanks for your feedback, we will investigate and fix the problem. Will reply here again with the fix.
-
0
Try this
.AddJwtBearer(options => { options.Authority = configuration["AuthServer:Authority"]; options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); options.Audience = "IssueManagement"; options.SecurityTokenValidators.Clear(); options.SecurityTokenValidators.Add(new JwtSecurityTokenHandler { InboundClaimTypeMap = { ["preferred_username"] = ClaimTypes.Name } }); });