https://github.com/gpreviatti/dotnet-api-with-keycloak
Prof of concept to test dotnet authentication and authorization with keycloak
https://github.com/gpreviatti/dotnet-api-with-keycloak
authentication authorization docker-compose dotnet keycloak postgresql
Last synced: 4 months ago
JSON representation
Prof of concept to test dotnet authentication and authorization with keycloak
- Host: GitHub
- URL: https://github.com/gpreviatti/dotnet-api-with-keycloak
- Owner: gpreviatti
- License: mit
- Created: 2023-01-03T13:09:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-25T17:11:32.000Z (over 3 years ago)
- Last Synced: 2025-08-24T15:47:14.003Z (10 months ago)
- Topics: authentication, authorization, docker-compose, dotnet, keycloak, postgresql
- Language: C#
- Homepage:
- Size: 247 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Dotnet api with Keycloak authentication/authorization
Prof of concept to test dotnet authentication and authorization with keycloak
## References
[Get starting with keycloak](https://www.keycloak.org/docs/latest/authorization_services/index.html#_getting_started_hello_world_create_realm)
[Blob post reference](https://nikiforovall.github.io/aspnetcore/dotnet/2022/08/24/dotnet-keycloak-auth.html)
## Run stack
```sh
cd infra && docker-compose up
```
## Backup and restore your configurations
Backup
```sh
cd infra && docker-compose exec keycloak kc.sh export --realm `` --dir /imports
```
Restore
```sh
cd infra && docker-compose exec keycloak kc.sh import --dir /imports
```
[Reference](https://www.keycloak.org/server/importExport#:~:text=To%20export%20a%20realm%2C%20you,started%20when%20invoking%20this%20command.&text=To%20export%20a%20realm%20to,%2D%2Ddir%20option.&text=When%20exporting%20realms%20to%20a,for%20each%20realm%20being%20exported.)
## Default credentials
Keycloak admin user
```
login: admin
password: admin
```
User with admin role
```
login: giovanni
password: Change@Me
```
User without admin role
```
login: joao
password: Change@Me
```
[Setup new realm wiki page](https://github.com/gpreviatti/dotnet-api-with-keycloak/wiki/Setup-new-Realm)