Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

 

 

If you have an existing Asp.Net Core application and want to integrate a secure user management system,

then you can create a Asp.Net Core ->Angular / React application with Authentication / Identity.

After that, you only have to integrate the database to the existing database via update database.

 

The Identity Framework creates a complete User Login/Logout Register System for existing applications.

The user pages are of course manageable.

Importantly, no passwords or private data are freely accessible on the server side, nor are they accessible to system administrators.

 

The existing database must be set in the file appsettings.json

Here is the local database for the website.

  "ConnectionStrings": {

    "DefaultConnection": "Server=.\\SQLEXPRESS;Database=codedocu_de;Trusted_Connection=True;MultipleActiveResultSets=true"

 

Im SQL Server Connectionstring

   //"Data" "Source=DESKTOP-F634M99\\SQLEXPRESS;Initial",

    //"Catalog=codedocu_de;Integrated" "Security=True;Connect",

    //"Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"

 

Then you start the integration from the ASP.Net Core / Angular or React project

By entering in the Package Manager Console:

 

Update-database

 

Finished.. this installs the Identity Framework into the connected database

 

 

The following tables are created using SQL script:

 

Identity Tables AspNetUser**

In the database you can find the new tables as dbo. AspNet* Tables

 

1428ca0b..

raimund.popp@code...de

RAIMUND...DE

Raimund...de

RAIMUND...DE

True

AQAAAAEAACcQA..

..

b….

NULL

False

False

NULL

True

0

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

 

CREATE TABLE [dbo].[AspNetUsers] (

    [Id]                   NVARCHAR (450)     NOT NULL,

    [UserName]             NVARCHAR (256)     NULL,

    [NormalizedUserName]   NVARCHAR (256)     NULL,

    [Email]                NVARCHAR (256)     NULL,

    [NormalizedEmail]      NVARCHAR (256)     NULL,

    [EmailConfirmed]       BIT                NOT NULL,

    [PasswordHash]         NVARCHAR (MAX)     NULL,

    [SecurityStamp]        NVARCHAR (MAX)     NULL,

    [ConcurrencyStamp]     NVARCHAR (MAX)     NULL,

    [PhoneNumber]          NVARCHAR (MAX)     NULL,

    [PhoneNumberConfirmed] BIT                NOT NULL,

    [TwoFactorEnabled]     BIT                NOT NULL,

    [LockoutEnd]           DATETIMEOFFSET (7) NULL,

    [LockoutEnabled]       BIT                NOT NULL,

    [AccessFailedCount]    INT                NOT NULL,

    CONSTRAINT [PK_AspNetUsers] PRIMARY KEY CLUSTERED ([Id] ASC)

);

 

 

GO

CREATE NONCLUSTERED INDEX [EmailIndex]

    ON [dbo].[AspNetUsers]([NormalizedEmail] ASC);

 

 

GO

CREATE UNIQUE NONCLUSTERED INDEX [UserNameIndex]

    ON [dbo].[AspNetUsers]([NormalizedUserName] ASC) WHERE ([NormalizedUserName] IS NOT NULL);

 

 

 

AspNetUserRoles

CREATE TABLE [dbo].[AspNetUserRoles] (

    [UserId] NVARCHAR (450) NOT NULL,

    [RoleId] NVARCHAR (450) NOT NULL,

    CONSTRAINT [PK_AspNetUserRoles] PRIMARY KEY CLUSTERED ([UserId] ASC, [RoleId] ASC),

    CONSTRAINT [FK_AspNetUserRoles_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE,

    CONSTRAINT [FK_AspNetUserRoles_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE

);

 

 

GO

CREATE NONCLUSTERED INDEX [IX_AspNetUserRoles_RoleId]

    ON [dbo].[AspNetUserRoles]([RoleId] ASC);

 

 

 

AspNetUserLogins

CREATE TABLE [dbo].[AspNetUserLogins] (

    [LoginProvider]       NVARCHAR (128) NOT NULL,

    [ProviderKey]         NVARCHAR (128) NOT NULL,

    [ProviderDisplayName] NVARCHAR (MAX) NULL,

    [UserId]              NVARCHAR (450) NOT NULL,

    CONSTRAINT [PK_AspNetUserLogins] PRIMARY KEY CLUSTERED ([LoginProvider] ASC, [ProviderKey] ASC),

    CONSTRAINT [FK_AspNetUserLogins_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE

);

 

 

GO

CREATE NONCLUSTERED INDEX [IX_AspNetUserLogins_UserId]

    ON [dbo].[AspNetUserLogins]([UserId] ASC);

 

 

 

 

[AspNetRoleClaims]

CREATE TABLE [dbo].[AspNetRoleClaims] (

    [Id]         INT            IDENTITY (1, 1) NOT NULL,

    [RoleId]     NVARCHAR (450) NOT NULL,

    [ClaimType]  NVARCHAR (MAX) NULL,

    [ClaimValue] NVARCHAR (MAX) NULL,

    CONSTRAINT [PK_AspNetRoleClaims] PRIMARY KEY CLUSTERED ([Id] ASC),

    CONSTRAINT [FK_AspNetRoleClaims_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE

);

 

 

GO

CREATE NONCLUSTERED INDEX [IX_AspNetRoleClaims_RoleId]

    ON [dbo].[AspNetRoleClaims]([RoleId] ASC);

 

 

 

AspNetRoles

CREATE TABLE [dbo].[AspNetRoles] (

    [Id]               NVARCHAR (450) NOT NULL,

    [Name]             NVARCHAR (256) NULL,

    [NormalizedName]   NVARCHAR (256) NULL,

    [ConcurrencyStamp] NVARCHAR (MAX) NULL,

    CONSTRAINT [PK_AspNetRoles] PRIMARY KEY CLUSTERED ([Id] ASC)

);

 

 

GO

CREATE UNIQUE NONCLUSTERED INDEX [RoleNameIndex]

    ON [dbo].[AspNetRoles]([NormalizedName] ASC) WHERE ([NormalizedName] IS NOT NULL);

 

 

 

 

AspNetUserClaims

CREATE TABLE [dbo].[AspNetUserClaims] (

    [Id]         INT            IDENTITY (1, 1) NOT NULL,

    [UserId]     NVARCHAR (450) NOT NULL,

    [ClaimType]  NVARCHAR (MAX) NULL,

    [ClaimValue] NVARCHAR (MAX) NULL,

    CONSTRAINT [PK_AspNetUserClaims] PRIMARY KEY CLUSTERED ([Id] ASC),

    CONSTRAINT [FK_AspNetUserClaims_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE

);

 

 

GO

CREATE NONCLUSTERED INDEX [IX_AspNetUserClaims_UserId]

    ON [dbo].[AspNetUserClaims]([UserId] ASC);

 

 

 

AspNetUserTokens

 

 

 

CREATE TABLE [dbo].[AspNetUserTokens] (

    [UserId]        NVARCHAR (450) NOT NULL,

    [LoginProvider] NVARCHAR (128) NOT NULL,

    [Name]          NVARCHAR (128) NOT NULL,

    [Value]         NVARCHAR (MAX) NULL,

    CONSTRAINT [PK_AspNetUserTokens] PRIMARY KEY CLUSTERED ([UserId] ASC, [LoginProvider] ASC, [Name] ASC),

    CONSTRAINT [FK_AspNetUserTokens_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE

);

 

Mobile

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de