A Minimalistic TokenServer based on the IdentityServer4 framework. Contains assembled and customized logic for Clients, ApiResources, ApiScopes and UserStore with integration to SQL Server database. Works based on the OAuth standards and can work as a boilerplate code for developers looking to setup a minimalistic TokenServer for development or staging environments.
IdentityServer4 is a .NET Core based framework for creating OAuth Token server. The library provides the necessary functionalities for building robust and customizable TokenServers which help in separating the User session and token management while the applications can focus on their actual business logic. Learn more about IdentityServer4 and implementing the various OAuth Grants using IdentityServer4 at https://referbruv.com/collections/developing-a-securetokenserver-and-authenticating-requests-using-identityserver4
The solution offers the following:
- Integration with Database for ClientStores and UserStores
- Seed Client, ApiScopes and Users which can be changed from database
- Contains auto-migration and Seeding logic which sets up the Database and adds the initial data
- Support for Social Logins (Google and Facebook). Just update the ClientId and ClientSecret values in the appsettings file
- Customized Login page. You can add your content in the placeholder divs inside the View
- One click Docker deployment - You can deploy and run the solution in Docker with a single command
- Separated Layers for UI, Core and Contracts
- ASP.NET Core 6
- Entity Framework Core 6
- Identity
- IdentityServer 4
- JWT Authentication Plugin for Google
- JWT Authentication Plugin for Facebook
- Docker
To get started with the solution:
- Install .NET 6 SDK
- Clone the repository in your local directory
- Navigate to ./SimpleSts.Web directory
- Update the ConnectionString in the appsettings JSON file
- Update the secrets for Facebook and Google plugins
Use the below command to run the application.
> dotnet build && dotnet run
Once the application starts successfully, navigate to http://localhost:5002/Account/Login and you should see the login page in the browser.
To run the solution in docker:
- Clone the repository in your local directory
- Update the secrets for Facebook and Google plugins similar to the step above
- Update the connection string in docker-compose.yml file present in the solution root
Run the below command, with Docker running.
> docker-compose up --force-recreate --build
Once the docker container starts successfully, navigate to http://localhost:5002/Account/Login and you should see the login page in the browser.
If you face any issues or would like to drop a suggestion,
Leave a Star if you find the solution useful. For more detailed articles and how-to guides, visit https://referbruv.com