asp.net-identity

.NET Identity UserManager.FindAsyc throwing “Invalid column name 'Discriminator'.”

巧了我就是萌 提交于 2021-02-07 10:34:17
问题 I created a new .NET Web Application project and choose the Individual User Account Authentication for the template I selected. By default this sets up the Identity database to be a local database in the App_Data directory. This worked fine. But then I needed the AspNet tables for membership to be in my real SQL Server database that holds the rest of my application. So I changed the DefaultConnection string to point to my local SQL Server database and when I reran the application, EF

Shorten access token returned by OWIN in ASP.NET WebAPI 2

此生再无相见时 提交于 2021-02-07 09:30:02
问题 We've developed a REST API using ASP.NET WebAPI 2 & secured it using ASP.NET Identity. The client required that their token be set to a long expiration time, as they store the access token in their database. During testing, they requested that we reduce the length of the token, as their database can only handle strings up to 250 characters. Our implementation is pretty "vanilla". Below are the options we're currently setting for the bearer token: OAuthOptions = new

Shorten access token returned by OWIN in ASP.NET WebAPI 2

怎甘沉沦 提交于 2021-02-07 09:28:29
问题 We've developed a REST API using ASP.NET WebAPI 2 & secured it using ASP.NET Identity. The client required that their token be set to a long expiration time, as they store the access token in their database. During testing, they requested that we reduce the length of the token, as their database can only handle strings up to 250 characters. Our implementation is pretty "vanilla". Below are the options we're currently setting for the bearer token: OAuthOptions = new

Azure AD as an “external provider”?

为君一笑 提交于 2021-02-07 08:39:46
问题 I'm trying to build a simple ASP.Net Core 2.2 web app that allows AzureAD as an "external provider". I'm doing this in Visual Studio 2019. As a super-simple demo project, I started by creating a new project that uses Azure AD as the login provider: Select ASP.NET Core Web Application Select Web Application (Model-View-Controller) Change Authentication to "Work or School Accounts". It automatically filled in my domain name (because I'm logged in to VS) This creates a web application set up to

Azure AD as an “external provider”?

我只是一个虾纸丫 提交于 2021-02-07 08:39:27
问题 I'm trying to build a simple ASP.Net Core 2.2 web app that allows AzureAD as an "external provider". I'm doing this in Visual Studio 2019. As a super-simple demo project, I started by creating a new project that uses Azure AD as the login provider: Select ASP.NET Core Web Application Select Web Application (Model-View-Controller) Change Authentication to "Work or School Accounts". It automatically filled in my domain name (because I'm logged in to VS) This creates a web application set up to

Asp.net core Identity “The INSERT statement conflicted with the FOREIGN KEY constraint ”

混江龙づ霸主 提交于 2021-02-07 07:51:41
问题 I create ASP.NET CORE application with ASP.NET CORE Identity. I create seed class for saving new users and roles for first startup application. Inside this seed class I get following error when I add Role To User. The INSERT statement conflicted with the FOREIGN KEY constraint "FK_AspNetUserRoles_AspNetUsers_UserId". The conflict occurred in database "DB_A14695_Elvinm", table "dbo.AspNetUsers", column 'Id'. The statement has been terminated. I used following class for Identity public class

The oauth state was missing or invalid. An error was encountered while handling the remote login

筅森魡賤 提交于 2021-02-06 14:17:53
问题 I am facing issues while implementing external login in asp.net core 2.2 (mvc) without using identity. After signing in to google it redirect back to callback url that is throwing exception as attached in the image below. Exception: The oauth state was missing or invalid. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync() For more detailed steps that I did, please check here

The oauth state was missing or invalid. An error was encountered while handling the remote login

南楼画角 提交于 2021-02-06 14:07:07
问题 I am facing issues while implementing external login in asp.net core 2.2 (mvc) without using identity. After signing in to google it redirect back to callback url that is throwing exception as attached in the image below. Exception: The oauth state was missing or invalid. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync() For more detailed steps that I did, please check here

The oauth state was missing or invalid. An error was encountered while handling the remote login

旧城冷巷雨未停 提交于 2021-02-06 14:06:40
问题 I am facing issues while implementing external login in asp.net core 2.2 (mvc) without using identity. After signing in to google it redirect back to callback url that is throwing exception as attached in the image below. Exception: The oauth state was missing or invalid. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync() For more detailed steps that I did, please check here

ASP.NET Core Identity - UserManager and UserStore woes

故事扮演 提交于 2021-02-06 11:22:32
问题 I'm trying to implement the Identity system in an ASP.NET Core app ( RC2 libraries) and there is a particular hangup that is driving me crazy. First of all, I am not using EntityFramework. I'm not even using SQL. I'm backing up to RavenDB , so I need the implementation to be very specific to that; Which isn't a problem. So I designed a RavenUserStore class, and it looks like this; public class RavenUserStore<TUser> : IUserStore<TUser>, IUserLoginStore<TUser>, IUserPasswordStore<TUser>,