Skip to content

vip32/aspnetcore-keycloak

Repository files navigation

keycloak client setup:

webapi appsettings:

 "Oidc": {
    "ClientId": "naos-sample",
    "ClientSecret": "8c87b1b0-9b2b-4ac6-bc37-88f093c04d13",
    "Authority": "http://localhost:8080/auth/realms/master"
  }

todos:

docker-compose

version: '3.4'

services:
  keycloak:
    image: jboss/keycloak
    depends_on:
      - mssql
      - mssqlscripts
    ports:
      - 80:8080 
    environment:
      - KEYCLOAK_USER=admin
      - KEYCLOAK_PASSWORD=admin
      - DB_VENDOR=mssql 
      - DB_USER=sa
      - DB_PASSWORD=Abcd1234!
      - DB_ADDR=mssql
      - DB_DATABASE=Keycloak

  mssql:
    image: mcr.microsoft.com/mssql/server
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=Abcd1234!
      - MSSQL_PID=Developer
    ports:
      - 1433:1433
    volumes:
      - mssql:/var/opt/mssql

  mssqlscripts:
    image: mcr.microsoft.com/mssql-tools
    depends_on:
      - mssql
    command: /bin/bash -c 'until /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P "Abcd1234!" -Q "create database Keycloak"; do sleep 5; done'

volumes:
  mssql:
    driver: local

links: