https://github.com/mmacneil/aspnetcoreapistarter
An ASP.NET Core (v2.1) Web API project to quickly bootstrap new projects. Includes Identity, JWT authentication w/ refresh tokens.
https://github.com/mmacneil/aspnetcoreapistarter
aspnetcore identity jwt jwt-authentication webapi
Last synced: 3 months ago
JSON representation
An ASP.NET Core (v2.1) Web API project to quickly bootstrap new projects. Includes Identity, JWT authentication w/ refresh tokens.
- Host: GitHub
- URL: https://github.com/mmacneil/aspnetcoreapistarter
- Owner: mmacneil
- License: mit
- Created: 2018-10-04T16:47:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-25T13:39:20.000Z (almost 3 years ago)
- Last Synced: 2025-03-29T21:09:21.105Z (3 months ago)
- Topics: aspnetcore, identity, jwt, jwt-authentication, webapi
- Language: C#
- Homepage: https://fullstackmark.com/post/19/jwt-authentication-flow-with-refresh-tokens-in-aspnet-core-web-api
- Size: 176 KB
- Stars: 356
- Watchers: 23
- Forks: 144
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AspNetCoreApiStarter
An ASP.NET Core (v2.1) Web API project to quickly bootstrap new projects. Includes Identity, JWT authentication w/ refresh tokens.# Setup
- Uses Sql Server Express LocalDB (If using Visual Studio install it under Individual Components in the Visual Studio installer or install separately using [this link](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2017).
- Apply database migrations to create the db. From a command line within the *Web.Api.Infrastructure* project folder use the dotnet CLI to run :
-Web.Api.Infrastructure>**dotnet ef database update --context AppDbContext**
-Web.Api.Infrastructure>**dotnet ef database update --context AppIdentityDbContext**
# Visual Studio
Open the solution fileAspNetCoreApiStarter.sln
and build/run.# Visual Studio Code
Open thesrc
folder andF5
to build/run.# Swagger Enabled
To explore and test the available APIs simply run the project and use the Swagger UI.The available APIs include:
- POST `/api/accounts` - Creates a new user.
- POST `/api/auth/login` - Authenticates a user.
- POST `/api/auth/refreshtoken` - Refreshes expired access tokens.
- GET `/api/protected` - Protected controller for testing role-based authorization.# Contact
[email protected]