question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Identity Core in .Net Framework

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
OpenSpacesAndPlacescommented, Apr 15, 2019

I’m going to go ahead and close this thread. I think my original question has been sufficiently answered. Thanks for wading through this.

0reactions
davidfowlcommented, Apr 13, 2019

These answers just raise more questions. How are you hosting SignalR in a System.Web application. I don’t understand your architecture enough to comment of the feasibility of a “pre migration”, the way you describe it today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to Identity on ASP.NET Core
ASP.NET Core Identity: Is an API that supports user interface (UI) login functionality. Manages users, passwords, profile data, roles, ...
Read more >
Introduction to ASP.NET Identity - ASP.NET 4.x
ASP.NET Identity can be used with all of the ASP.NET frameworks, such as ASP.NET MVC, Web Forms, Web Pages, Web API, and SignalR....
Read more >
Identity model customization in ASP.NET Core
This article describes how to customize the underlying Entity Framework Core data model for ASP.NET Core Identity.
Read more >
Secure a .NET web app with the ASP.NET Core Identity ...
Learn how to add authentication and authorization to a .NET web app using the ASP.NET Core Identity framework.
Read more >
ASP.NET Core - Identity Overview
ASP.NET Core Identity framework is used to implement forms authentication. There are many options to choose from for identifying your users including Windows ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found