{"id":22191604,"url":"https://github.com/vip32/aspnetcore-keycloak","last_synced_at":"2025-07-26T22:31:33.373Z","repository":{"id":38641057,"uuid":"224053365","full_name":"vip32/aspnetcore-keycloak","owner":"vip32","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T12:40:38.000Z","size":2138,"stargazers_count":74,"open_issues_count":30,"forks_count":29,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-08T16:29:56.405Z","etag":null,"topics":["keycloak","netcore3","webapi"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vip32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-25T22:27:28.000Z","updated_at":"2024-04-08T16:29:56.406Z","dependencies_parsed_at":"2023-02-07T04:33:35.664Z","dependency_job_id":null,"html_url":"https://github.com/vip32/aspnetcore-keycloak","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip32%2Faspnetcore-keycloak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip32%2Faspnetcore-keycloak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip32%2Faspnetcore-keycloak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip32%2Faspnetcore-keycloak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vip32","download_url":"https://codeload.github.com/vip32/aspnetcore-keycloak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227724162,"owners_count":17810036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keycloak","netcore3","webapi"],"created_at":"2024-12-02T12:16:47.318Z","updated_at":"2024-12-02T12:16:47.860Z","avatar_url":"https://github.com/vip32.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"keycloak client setup:\n![](keycloak_client_setup.png)\n\n- Client Protocol = openid-connect\n- Access Type = confidential\n  - client secret will appear under 'Credentials' after saving\n- Valid Redirect URIs = \n  - for ASP.Net Core Authentication Middleware https://localhost:5001/signin-oidc + https://localhost:5001/signout-callback-oidc\n  - for custom html login https://localhost:5001/signin-oidc-callback.html\n- Web Origins = * (otherwise /userinfo request will have empty response)\n\n### webapi appsettings:\n```\n \"Oidc\": {\n    \"ClientId\": \"naos-sample\",\n    \"ClientSecret\": \"8c87b1b0-9b2b-4ac6-bc37-88f093c04d13\",\n    \"Authority\": \"http://localhost:8080/auth/realms/master\"\n  }\n```\n\n### todos:\n- blazor app https://auth0.com/blog/what-is-blazor-tutorial-on-building-webapp-with-authentication/#Securing-the-Application-with-Auth0\n- [DONE] simple html page for login https://github.com/GluuFederation/openid-implicit-client\n- autosetup keycloak client? with api request? \n  - https://www.7p-group.com/blog/integrationstests-mit-testcontainers-spring-security-und-keycloak/\n  - https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_clients_resource\n  - https://stackoverflow.com/questions/53283281/how-to-activate-the-rest-api-of-keycloak\n \n\n### docker-compose\n```\nversion: '3.4'\n\nservices:\n  keycloak:\n    image: jboss/keycloak\n    depends_on:\n      - mssql\n      - mssqlscripts\n    ports:\n      - 80:8080 \n    environment:\n      - KEYCLOAK_USER=admin\n      - KEYCLOAK_PASSWORD=admin\n      - DB_VENDOR=mssql \n      - DB_USER=sa\n      - DB_PASSWORD=Abcd1234!\n      - DB_ADDR=mssql\n      - DB_DATABASE=Keycloak\n\n  mssql:\n    image: mcr.microsoft.com/mssql/server\n    environment:\n      - ACCEPT_EULA=Y\n      - SA_PASSWORD=Abcd1234!\n      - MSSQL_PID=Developer\n    ports:\n      - 1433:1433\n    volumes:\n      - mssql:/var/opt/mssql\n\n  mssqlscripts:\n    image: mcr.microsoft.com/mssql-tools\n    depends_on:\n      - mssql\n    command: /bin/bash -c 'until /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P \"Abcd1234!\" -Q \"create database Keycloak\"; do sleep 5; done'\n\nvolumes:\n  mssql:\n    driver: local\n```\n\nlinks:\n- https://developer.okta.com/blog/2019/11/15/aspnet-core-3-mvc-secure-authentication","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvip32%2Faspnetcore-keycloak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvip32%2Faspnetcore-keycloak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvip32%2Faspnetcore-keycloak/lists"}