Skip to content

Identity Core in .Net Framework #9185

@OpenSpacesAndPlaces

Description

@OpenSpacesAndPlaces

I have most of the nuts and bolts I need in place to get Identity Core working in a .Net Framework environment.

One thing I'm running into:
Microsoft.AspNetCore.Http.HttpContext

is used for:
public SignInManager(UserManager<TUser> userManager, IHttpContextAccessor contextAccessor, IUserClaimsPrincipalFactory<TUser> claimsFactory, IOptions<IdentityOptions> optionsAccessor, ILogger<SignInManager<TUser>> logger, IAuthenticationSchemeProvider schemes);

I would just do like:
new HttpContextAccessor() { HttpContext = ctx }

However, I only seem to have access to:
System.Web.HttpContext

"SignInManager" seems to be working, it just doesn't have an HttpContext I can give it so it can set authentication cookies.

I also tried something like:

HttpContextAccessor hca = new HttpContextAccessor() {HttpContext = new DefaultHttpContext()};
....SignInAsync...
hca.HttpContext.Response.Cookies...
hca.HttpContext.Identity...

But that did not work either (nothing was set).


Is there there a way I can workaround?

Any help would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-identityIncludes: Identity and providers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions