asp.net-identity

Is the asp.net mvc 5 sample project with 2 factor authentication a sample or production ready?

烈酒焚心 提交于 2019-12-12 20:11:58
问题 It seems like the only way I can currently get 2 factor authentication from identity 2 is if I create an empty MVC 5 app then install the Identity samples Pre release with the package manager like so: Install-Package -Prerelease Microsoft.AspNet.Identity.Samples But it seems like this is only a sample and not something I can use for a real app? Can I use this "sample" project as a real app? It says in the documentation at www.asp.net/identity that it is a production release! I just want to

WebApi Authorize attribute with services.AddIdentity returns 404 Not Found

て烟熏妆下的殇ゞ 提交于 2019-12-12 20:06:50
问题 I have a simple WebApi project, which uses IdentityServer4.AccessTokenValidation to validate tokens issued by an IdentityServer4 Server at development address: https://localhost:44347 I get the token by sending following data to identityserver: POST https://localhost:44347/connect/token client_id:x.api.client client_secret:secret response_type:code id_token scope:X.api grant_type:client_credentials Response is: { "access_token": "THETOKEN", "expires_in": 1209600, "token_type": "Bearer" } and

Entity Framework caching in aspnet Identity

喜你入骨 提交于 2019-12-12 18:16:58
问题 I'm building a project in EF6 and aspnet Identity. I'm facing the following problem: if I call var account = await FindByNameAsync(userName); // account.IsConfirmed = true I get the account I'm looking for (example: isConfirmed = true). When I manually change a value in my database (isConfirmed = true -> isConfirmed = false) and I run my query again, I still get my old account object (isConfirmed = true) var account = await FindByNameAsync(userName); // Should be account.IsConfirmed = false,

Table not mapped using EF code first approach

情到浓时终转凉″ 提交于 2019-12-12 16:56:56
问题 I'd like to use EF code first approach . I added the database and I generate the tables . Then I added this class public class Invitation { [Key] public int Id { get; set; } [DefaultValue(false)] public bool State { get; set; } public string Mail { get; set; } public string Tel { get; set; } public string Name { get; set; } public string Qr_code { get; set; } } I run these command then : add-migrations second update-database the Up and Down methods of the second class migration are empty!!

Mono with Owin Authentication

杀马特。学长 韩版系。学妹 提交于 2019-12-12 15:01:45
问题 I have an Owin application I'm running in Mono, and I'm trying to get authentication to work properly on it. I used the info on this page as a start. I quickly realized that Owin Authentication uses some Windows specific libraries. This question had a workaround for that, though, which I thought would be enough. It wasn't. The following code throws the exception described in the other question (in another place than the question describes (see comment in code)). If I try to comment out stuff

How to Define and use Different User Types in ASP.NET Core

主宰稳场 提交于 2019-12-12 13:29:10
问题 The application has the following users and controller in ASP.NET Core 2.1. AppUser using Microsoft.AspNetCore.Identity; namespace MyApp.Models { public class AppUser : IdentityUser { public string FirstName { get; set; } public string LastName { get; set; } } } DifferentUser namespace MyApp.Models { public class DifferentUser : AppUser { public string Property1 { get; set; } } } DifferentUserController.cs using System.Threading.Tasks; using MyApp.Models; using Microsoft.AspNetCore

ASP.Net Identity provider requesting too much info

喜欢而已 提交于 2019-12-12 12:25:20
问题 I have asp.net indentity working fine. However when a user logs in, Google asks the user if it's OK to provide the following information: - View your email address - View basic information about your account The problem is that I don't even want that information. I just want a unique way to identify the user (which it does provide). I don't want users thinking i'm going to spam them when they sign in. In Startup.Auth.cs I use a very vanilla google setup: app.UseGoogleAuthentication(); EDIT:

ASP.NET Identity and IdentityServer connection

旧街凉风 提交于 2019-12-12 11:24:22
问题 Can somebody explain the connection between Identity and IdentityServer? There was a recent article that says there will be a new version of IdentityServer (ie IdentityServer 4). I'm doing a ASP.NET 5 project. I only heard of Identity 3 before and I'm planning to use it. Can I use Identity 3 in my project without using this IdentityServer? 回答1: Can somebody explain the connection between Identity and IdentityServer? There's no direct connection: ASP.NET Identity is a membership provider (i.e

InvalidOperationException: No IAuthenticationSignInHandler is configured to handle sign in for the scheme: Identity.Application

对着背影说爱祢 提交于 2019-12-12 10:25:15
问题 Hi. I create new AspNet core MVC project AND attached to it a custom UserManager,UserStore,SignInManager that work with Nhibernate, and when i am trying to auth application throw exception How to Solve it ? many articles in google dont help me InvalidOperationException: No IAuthenticationSignInHandler is configured to handle sign in for the scheme: Identity.Application Microsoft.AspNetCore.Authentication.AuthenticationService+ d__13.MoveNext() System.Runtime.CompilerServices.TaskAwaiter

Save tokens in Cookie with ASP.NET Core Identity

本秂侑毒 提交于 2019-12-12 10:14:46
问题 I want to save something inside my 'Identity' generated cookie. I'm currently using the default Identity setup from the Docs. Startup.cs services.Configure<IdentityOptions>(options => { // User settings options.User.RequireUniqueEmail = true; // Cookie settings options.Cookies.ApplicationCookie.AuthenticationScheme = "Cookies"; options.Cookies.ApplicationCookie.ExpireTimeSpan = TimeSpan.FromHours(1); options.Cookies.ApplicationCookie.SlidingExpiration = true; options.Cookies.ApplicationCookie