Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yogyogi/identityserver-with-asp.net-core-identity-and-mongodb-as-database
IdentityServer with ASP.NET Core Identity and MongoDB as Database
https://github.com/yogyogi/identityserver-with-asp.net-core-identity-and-mongodb-as-database
asp-net-core asp-net-core-identity identityserver4 jwt mongodb
Last synced: 9 days ago
JSON representation
IdentityServer with ASP.NET Core Identity and MongoDB as Database
- Host: GitHub
- URL: https://github.com/yogyogi/identityserver-with-asp.net-core-identity-and-mongodb-as-database
- Owner: yogyogi
- Created: 2021-08-18T16:21:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T18:26:48.000Z (9 months ago)
- Last Synced: 2024-02-17T19:24:48.707Z (9 months ago)
- Topics: asp-net-core, asp-net-core-identity, identityserver4, jwt, mongodb
- Language: C#
- Homepage: https://www.yogihosting.com/identityserver-aspnet-core-identity-mongodb-database/
- Size: 11.1 MB
- Stars: 20
- Watchers: 2
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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!