.NET 6.0 MVC Website integrated with ServiceStack using ASP.NET Identity Auth
Login
Browse source code and install with the
web
dotnet tool:
$ dotnet tool install -g x
$ x new LegacyTemplates/mvcidentity ProjectName
Alternatively write new project files directly into an empty repository, using the Directory Name as the ProjectName:
$ git clone https://github.com/<User>/<ProjectName>.git
$ cd <ProjectName>
$ x new mvcidentity
To create the User and Auth tables you will need access to SQL Server instance then change the "DefaultConnection"
connection string in appsettings.json
then you can run the ef .NET Core tool:
$ dotnet ef migrations add Create{ProjectName}IdentitySchema
$ dotnet ef database update
If needed, you can re-create your DB schema after modifying your custom ApplicationUser
class with additional info you want to store on each user, by deleting the __EFMigrationHistory
and all AspNet*
tables, deleting the Migrations
folder in your host projects and re-running the above commands.
Replace the oauth.*
App settings with your own in appsettings.Development.json
for local development and appsettings.json
for production deployments.
- Twitter - Create Twitter App with
{BaseUrl}/signin-twitter
referrer and follow Twitter walk through - Facebook - Create Facebook App with
{BaseUrl}/signin-facebook
referrer and follow Facebook walk through - Google - Create Google App with
{BaseUrl}/signin-google
referrer and follow Google walk through - Microsoft - Create Microsoft App with
{BaseUrl}/signin-microsoft
referrer and follow Microsoft walk through