Coder Social home page Coder Social logo

yogyogi / identityserver-with-asp.net-core-identity-and-mongodb-as-database Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 13.0 11.33 MB

IdentityServer with ASP.NET Core Identity and MongoDB as Database

Home Page: https://www.yogihosting.com/identityserver-aspnet-core-identity-mongodb-database/

C# 49.17% HTML 26.66% CSS 23.21% JavaScript 0.96%
identityserver4 asp-net-core asp-net-core-identity jwt mongodb

identityserver-with-asp.net-core-identity-and-mongodb-as-database's Introduction

IdentityServer with ASP.NET Core Identity and MongoDB as Database

In this repo we will implement IdentityServer with ASP.NET Core Identity and MongoDB as Database. So, the MongoDB will be the Identity Database instead of SQL Server. I have explained all the setup steps on my tutorial. This tutorial contains the following topics.

Topics

  1. What is IdentityServer
  2. What we will build?
  3. IdentityServer OpenID Connect OAuth 2.0
  4. Creating IdentityServer 4 Project
  5. Setup IdentityServer in ASP.NET Core
  6. IdentityServer settings in appsettings.json
  7. What are IdentityServer Clients
  8. What are IdentityServer ApiScopes
  9. What are IdentityServer ApiResources
  10. Defining IdentityServer settings class
  11. Configure IdentityServer on Startup.cs
  12. IdentityServer Discovery Endpoint
  13. Fetching IdentityServer Token from Postman
  14. Implementing OpenID Connect
  15. Calling IdentityServer secured Web API
  16. IdentityServer Role Based Authentication
  17. Role Claim in OpenID Connect
  18. Role claims in the ClaimsPrincipal
  19. Securing Controllers with Role Based Authentication
  20. IdentityServer Policy Based Authentication

Running the projects

There are 2 projects: - ISExample & ISClient. ISExample is the Identity Server. ISClient is the client that contains secured web api.

Running "ISExample" - Inside the ISExample project their is docker-compose.yml for MongoDB. Run it with docker-compose up -d to start the container. Now run "ISExample" on IIS Express. Now create user account with the "Create Identity User" link on the Menu. It's url is - https://localhost:44312/Operations/Create. If you want to go to details about MongoDB and Identity setup then visit ASP.NET Core Identity with MongoDB as Database/.

Running "ISClient" - Run the project on https kestrel hosting and not IIS Express. Now click "Secured" menu link. You will be redirected to Identity Server asking to log on. Log on with your account. Next you will be redirected to client project and you will see secured weather data.

Note - If you want to test login again then you have to delete all the cookies from the "Application" tab of developers tools of your browser.

Want to support me ?

Your support of every $5 will be a great reward for me to carry on my work. Thank you!

Buy Me A Coffee Paypal Me

identityserver-with-asp.net-core-identity-and-mongodb-as-database's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.