asp.net-identity

Problems registering a receiver with Microsoft Webhooks

拥有回忆 提交于 2019-12-25 09:18:24
问题 I'm trying to register a subscriber to events for using the following example. When I use the POST method, I get a bad request error (400), so I've attempted to visit the url where the request is sent and received using a browser and received the following stack trace: When visiting https://localhost:44300/api/webhooks/registrations I get: > {"message":"An error has occurred.","exceptionMessage":"General error > during 'Get' operation: 'An error occurred while executing the command >

How to inject UserManager & SignInManager

强颜欢笑 提交于 2019-12-25 06:34:04
问题 I am trying to figure out how to inject UserManager and SignInManager. I have installed Ninject in my application and I am using it in the following manner: Please consider this to be a brand new project. Inside Startup.cs I have the following: public partial class Startup { public void Configuration(IAppBuilder app) { ConfigureAuth(app); app.UseNinjectMiddleware(CreateKernel); } private static IKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Load(Assembly

Add Primary Key of Linked Table to ASPNETUsers table Id field

我的梦境 提交于 2019-12-25 05:37:30
问题 I have successfully linked aspnetusers table to my custom users table as one-to-one relationship. Now when i go to register all information is successfully added to both tables except one thing - Id. My pk userId in users table is an AutoIncrement key and i wish to add the same value in the id field of aspnetUsers table. I think i will have to override createAsync or do i remove from SignInAsync await user.GenerateUserIdentityAsync(UserManager) Inside AccountController Register method, I have

Generate a PasswordHash and SecurityStamp

折月煮酒 提交于 2019-12-25 04:22:13
问题 I have a Registrations table which new users get put into. A later process creates a database for that user, and inserts an ASP.NET Identity User record from the data in the registration table (email & name). I'd like to extend this so that at the point of registration, users can enter their password, which will then be set up in the new database. To do this properly, I'd need to create a SecurityStamp value and then encrypt the password using that to get the PasswordHash , I believe. So then

Can't get .net core MVC to redirect 401 to /Account/Login

╄→гoц情女王★ 提交于 2019-12-25 04:12:31
问题 When I request a controller action that is [Authorize] decorated instead of being redirected to the login page I receive a 401 error. This is a .net core mvc app using the identity template running on IIS express. When i run the app from program.cs the redirect to login works fine. I've added explicit directions to for the cookie authentication to use the /Account/Login redirect both for configuration and services section, as well as configuring Identity to perform this redirect. I can't get

How do you access a models related properties using Entity Framework? [closed]

a 夏天 提交于 2019-12-25 03:42:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I'm developing a simple application that will allow users to create a profile and upload multiple images. I'm using ASP.NET Identity and will therefore refer to "user" as ApplicationUser . I have an Image and an ApplicationUser domain model shown below: public class ApplicationUser : IdentityUser {

How do you access a models related properties using Entity Framework? [closed]

雨燕双飞 提交于 2019-12-25 03:41:32
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I'm developing a simple application that will allow users to create a profile and upload multiple images. I'm using ASP.NET Identity and will therefore refer to "user" as ApplicationUser . I have an Image and an ApplicationUser domain model shown below: public class ApplicationUser : IdentityUser {

IdentityServer4 claims are not part of the token on hybrid flow

六眼飞鱼酱① 提交于 2019-12-25 01:45:08
问题 I'm trying to build a hybrid flow, and have claims on the returned access token with IdentityServer4. I'm using the QuickStart UI controlles. In my AccountController after the user was authenticated successfully, I have the following code which signs him in: await HttpContext.SignInAsync("anon@nymous.com", "anon@nymous.com", null, new Claim("MyName", "Ophir")); In the MVC website that is causing this flow, on the page I want to "protect" I have the following code: [Authorize] public

Session expire problen in ASP.NET CORE 2.2 WEB APP

家住魔仙堡 提交于 2019-12-24 22:25:30
问题 I need to expire the session, sending the user back to the Login page when he try to reuse the app. For this purpose I modified startup.cs and created a custom Action Filter that handles session expiration and if session is null, it redirects to Login Action. startup.cs code // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { string con = Configuration.GetConnectionString("EBBDatabase");

How to fix problem of update users in asp.net web API

不羁的心 提交于 2019-12-24 19:13:41
问题 I develop function for update user, but in backend, I have error: System.NullReferenceException: 'The object reference is not defined to an instance of an object.' users was null. I think because users is null, and I don't know how to make a call to fill users data. this error displays in the condition if(id!= users.ID) ,how to fix this problem, here is my code: [ResponseType(typeof(void))] // [HttpPut] [AcceptVerbs("OPTIONS")] public IHttpActionResult PutUsers(string id, Users users) { if (