https://github.com/developer-seb-v/e-commerce-aspnet-identity-default
https://github.com/developer-seb-v/e-commerce-aspnet-identity-default
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/developer-seb-v/e-commerce-aspnet-identity-default
- Owner: developer-seb-v
- Created: 2025-06-05T06:00:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-05T06:39:10.000Z (about 1 year ago)
- Last Synced: 2025-06-05T07:52:23.107Z (about 1 year ago)
- Language: C#
- Size: 10.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a boilerplate for using ASPNET IDENTITY for cookie-based authentication/authorization. It uses PostgreSQL running in a Docker container with a volume mounted to it for data persistence. Obviously, this project has no controller endpoints. You still need to create your controllers or minimal API style endpoints. You can also add JWT as well if you'd like. Can run on win, mac, linux.
Make sure you have the following installed:
dotnet 8 sdk, entity framework CLI, docker
Steps to reproduce:
1- clone repo
2- delete "Migrations" folder
3- in your terminal/cmd line run the following command to create docker volume:
docker volume create volume02
4- then type in this command to create and run the PostgreSQL container:
docker run --name postgres -e POSTGRES_PASSWORD=password123 \
-p 5432:5432 -v volume02:/var/lib/postgresql/data -d postgres
5- run dotnet ef migrations "name of your migration"
dotnet ef database update
These will populate the postgres DB with the Identity library-provided tables for authentication.
To connect to postgreSQL db, open an interactive terminal and run this command:
psql -U postgres
then: \c auth_db; (to connect to the db ef created)
then: \dt; (to show the tables that ef created)
Schema | Name | Type | Owner
--------+-----------------------+-------+----------
public | AspNetRoleClaims | table | postgres
public | AspNetRoles | table | postgres
public | AspNetUserClaims | table | postgres
public | AspNetUserLogins | table | postgres
public | AspNetUserRoles | table | postgres
public | AspNetUserTokens | table | postgres
public | AspNetUsers | table | postgres
public | __EFMigrationsHistory | table | postgres