asp.net-identity

asp.net web form client with identity server 4

回眸只為那壹抹淺笑 提交于 2019-12-20 12:26:54
问题 I have a asp.net solution which consists of 1). asp.net identity server rc 3 2). asp.net Core web api 3). asp.net webform ( not in asp.net core, client) I don't see any sample with identity server 4 and web form client. Can you please suggest how to authenticate web form user using identity server with asp.net identity and then call api with the access token ? I don't see identity server 4 sample with web form client or sample identity server 3 has a sample but it is doing everything in

Updating user by UserManager.Update() in ASP.NET Identity 2

一曲冷凌霜 提交于 2019-12-20 11:55:17
问题 I use ASP.NET Identity 2 in an MVC 5 project and I want to update Student data by using UserManager.Update() method. However, as I inherit from ApplicationUser class, I need to map Student to ApplicationUser before calling update method. On the other hand, when using the approach that I also used for creating new Student, there is an error due to concurrency as I create a new instance rather than update. As I am bored to solve the problem using AutoMapper , I need a stable fix to solve the

ASP.NET Identity Provider SignInManager Keeps Returning Failure

杀马特。学长 韩版系。学妹 提交于 2019-12-20 10:34:13
问题 I have an issue with the standard ASP Identity provider for MVC5. As soon as I log in the method: await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); keeps returning Failure. So I started debugging, By using: UserManager.FindByEmail(model.Email); This returns a valid UserID for my user trying to log in. Then I used: SignInManager.UserManager.CheckPassword(UserIDObtainedFromFind, model.Password); And this returns true, which means that

Best practice for storing ASP.NET Core Authorization claims when authenticating users against Active Directory?

这一生的挚爱 提交于 2019-12-20 10:33:07
问题 I am creating an enterprise intranet ASP.NET Core MVC application. I want my users to authenticate using Active Directory and I want user authorizations (claims) stored in ApplicationDbContext . I assume that I need to use Microsoft.AspNetCore.Identity and Microsoft.AspNetCore.Identity.EntityFrameworkCore to accomplish my goals. What is the best practice for storing ASP.NET Core Authorization claims when authenticating against Active Directory? The following code will give me access to the

ASP.net Identity, IoC and sharing DbContext

让人想犯罪 __ 提交于 2019-12-20 10:27:57
问题 Have anyone been successful in attaching an IoC with OWIN ASP.NET Identity to share the same DbContext as the WebApi (or MVC) application? I would like that if ASP.Net identity loads the user, it loads in the same dbcontext as used in the rest of the application. (using AutoFac as IoC - but wouldn't mind an example with other container) Edit : 06/Jan/2014: Just to be a bit more specific, when the ASP.Net identity attempts to use a DbContext it needs to be the same DbContext instance as the

How can I instantiate OWIN IDataProtectionProvider in Azure Web Jobs?

非 Y 不嫁゛ 提交于 2019-12-20 09:38:03
问题 I need an instance of IDataProtectionProvider to generate email confirmation tokens using the Identity Framework UserManager in an Azure Web Jobs worker: var confirmToken = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); This crashes because a null IUserTokenProvider<User, int> was passed to the UserManager<User, int> upon constuction. In the MVC application an instance is created like this: public class OWINStartup { public void Configuration(IAppBuilder app) { var

Using ASP.Net Identity in MVC 4

有些话、适合烂在心里 提交于 2019-12-20 09:04:15
问题 I've been reading about the new auth stuff in the upcoming versions of ASP.net: http://blogs.msdn.com/b/webdev/archive/2013/06/27/introducing-asp-net-identity-membership-system-for-asp-net-applications.aspx I'm creating a new ASP.net MVC 4 project in visual studio 2012 and I'd like to use the new auth bits if I can. Is this possible? I'm reading code and trying to wrap my head around this new API. But in the meantime, what steps are involved to get going? 回答1: It should be doable, first you

ASP.NET Identity 2 - UserManager.ConfirmEmail Fails In Production

☆樱花仙子☆ 提交于 2019-12-20 07:31:27
问题 I've set up OWIN in an ASP.NET MVC app (including email confirmation). When an account is created I get an email containing a link to confirm my email. When I visit the link, I get the "Invalid Token" error. If I take that exact same link and instead change the domain to point at localhost while debugging the project, the email confirms just fine. The project is being deployed to an Azure Web Site (which I can't remote debug). I've tossed in some code to email me when confirmation fails (so

ASP.NET Identity 2 - UserManager.ConfirmEmail Fails In Production

馋奶兔 提交于 2019-12-20 07:31:23
问题 I've set up OWIN in an ASP.NET MVC app (including email confirmation). When an account is created I get an email containing a link to confirm my email. When I visit the link, I get the "Invalid Token" error. If I take that exact same link and instead change the domain to point at localhost while debugging the project, the email confirms just fine. The project is being deployed to an Azure Web Site (which I can't remote debug). I've tossed in some code to email me when confirmation fails (so

How to link one-to-one relationship when fk is different from pk - EntityFramework

假装没事ソ 提交于 2019-12-20 04:59:08
问题 I have a custom users table in my database and i want to create a one-to-one relationship with aspnetusers table so that when i register a new customer, applicationuser class through UserManager should add the username, email, password and school code to the users table and add an fk in its own table. IS there any tutorial/example implementing this kind of scenario? I am trying to add a one-to-one relationship with my users table but the fk is different than pk Users Table [columns] username