Switch everything to use the OHIF realm; we can't seed the master realm, because it already exists.

This commit is contained in:
dannyrb 2019-05-09 10:43:59 -04:00
parent b1ef87cfce
commit 060882d93a
5 changed files with 793 additions and 849 deletions

View File

@ -29,30 +29,3 @@ https://github.com/maxmantz/redux-oidc
- Set admin user/pass in `docker-compose` - Set admin user/pass in `docker-compose`
- What are realms? - What are realms?
## Useful Commands
List containers: `docker ps`
Stop running all containers:
- Win: `docker ps -a -q | ForEach { docker stop $_ }`
- Linux: `docker stop $(docker ps -a -q)`
Interact w/ running container:
`docker exec -it CONTAINER_NAME bash`
To delete containers not in use: `docker prune`
Test nginx.conf:
`docker run --rm -t -a stdout --name my-openresty -v $PWD/config/:/usr/local/openresty/nginx/conf/:ro openresty/openresty:alpine-fat openresty -c /usr/local/openresty/nginx/conf/nginx.conf -t`
## Resources
- http://www.staticshin.com/programming/definitely-an-open-resty-guide/#access_by_lua
## TODO
- Add build step for `authproxy` to docker-compose script

View File

@ -76,10 +76,10 @@ http {
access_by_lua_block { access_by_lua_block {
local opts = { local opts = {
redirect_uri = "http://127.0.0.1/pacs-admin/admin", redirect_uri = "http://127.0.0.1/pacs-admin/admin",
discovery = "http://127.0.0.1/auth/realms/master/.well-known/openid-configuration", discovery = "http://127.0.0.1/auth/realms/ohif/.well-known/openid-configuration",
token_endpoint_auth_method = "client_secret_basic", token_endpoint_auth_method = "client_secret_basic",
client_id = "pacs", client_id = "pacs",
client_secret = "a726f5b1-5abd-42c9-b7b1-53a1a17d2ad2", client_secret = "66279641-eba6-47f5-9fdb-70c4ac74d548",
client_jwt_assertion_expires_in = 60 * 60, client_jwt_assertion_expires_in = 60 * 60,
ssl_verify = "no", ssl_verify = "no",
scope = "openid email profile", scope = "openid email profile",
@ -123,7 +123,7 @@ http {
location /pacs/ { location /pacs/ {
access_by_lua_block { access_by_lua_block {
local opts = { local opts = {
discovery = "http://127.0.0.1/auth/realms/master/.well-known/openid-configuration", discovery = "http://127.0.0.1/auth/realms/ohif/.well-known/openid-configuration",
} }
-- call bearer_jwt_verify for OAuth 2.0 JWT validation -- call bearer_jwt_verify for OAuth 2.0 JWT validation

View File

@ -28,7 +28,7 @@ FROM node:11.2.0-slim as builder
RUN mkdir /usr/src/app RUN mkdir /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
ENV REACT_APP_CONFIG=config/example_openidc.js ENV REACT_APP_CONFIG=config/docker_openresty-orthanc-keycloak.js
ENV PATH /usr/src/app/node_modules/.bin:$PATH ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/package.json COPY package.json /usr/src/app/package.json

View File

@ -1,9 +1,8 @@
window.config = { window.config = {
// default: '/'
routerBasename: '/', routerBasename: '/',
// default: ''
relativeWebWorkerScriptsPath: '', relativeWebWorkerScriptsPath: '',
servers: { servers: {
// This is an array, but we'll only use the first entry for now
dicomWeb: [ dicomWeb: [
{ {
name: 'Orthanc', name: 'Orthanc',
@ -17,20 +16,19 @@ window.config = {
// https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54 // https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version // TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
requestOptions: { requestOptions: {
// auth: 'orthanc:orthanc', // undefined to use JWT + Bearer auth // undefined to use JWT + Bearer auth
// auth: 'orthanc:orthanc',
requestFromBrowser: true, requestFromBrowser: true,
// logRequests: true,
// logResponses: false,
// logTiming: true,
}, },
}, },
], ],
}, },
// This is an array, but we'll only use the first entry for now
oidc: [ oidc: [
{ {
// ~ REQUIRED // ~ REQUIRED
// Authorization Server URL // Authorization Server URL
authority: 'http://127.0.0.1/auth/realms/master', authority: 'http://127.0.0.1/auth/realms/ohif',
client_id: 'ohif-viewer', client_id: 'ohif-viewer',
redirect_uri: 'http://127.0.0.1/callback', // `OHIFStandaloneViewer.js` redirect_uri: 'http://127.0.0.1/callback', // `OHIFStandaloneViewer.js`
// "Authorization Code Flow" // "Authorization Code Flow"