0

Please or Register to create posts and topics.

User Information

I am trying to get the user information with User.Identity in web controllers and/or the DAL repository classes.  Most of the information is null even when logged in.  Is there a way for me to access it?  Please see attached file.

 

I have not the same problem but something related with, sorry for the hijacking, when I try to access to roles, the users list or the user information, I have this error:

An error occured whilst saving configuration defaults. Errors: "error: IDX10803: Unable to obtain configuration from: 'http://localhost:5151/.well-known/openid-configuration'."

BTW my version is the standrad with Bootstrap 4.

I'm realizing context.CurrentUserId is null as well.  It gets set here.  Could you please help me out?

public HttpUnitOfWork(ApplicationDbContext context, IHttpContextAccessor httpAccessor) : base(context)
{
context.CurrentUserId = httpAccessor.HttpContext?.User.FindFirst(ClaimConstants.Subject)?.Value?.Trim();
}

I solve my problem, in appsettings.json, appsettings.development.json change

"ApplicationUrl": "http://localhost:5151"

to

"ApplicationUrl": "http://localhost:5000"

 

Thanks for responding Marco, unfortunately the application URL is already set to the correct url.

Eben, do you have any ideas here?