Code Monkey home page Code Monkey logo

openidc-ohif-orthanc's Introduction

OHIF Viewer Using PACS Server (Orthanc) Protected by OpenID

We protect the PACS Server with OpenID, like corporate SSO.

Based on OpenResty (nginx + lua) and Keycloak for OpenID auth.

Use https://github.com/zmartzone/lua-resty-openidc for authentication.

A simple solution that works well, unlike others we've tried.

CORS

We solve CORS issues by proxying all services through a single host. Services are proxied from viewer, which combines OpenResty and OHIF viewer.

This eliminates CORS problems.

Auth Session - Nginx Config

Adjust session.cookie.renew and session.cookie.lifetime for session timing.

Set cookie domain with authenticate()'s fourth argument:

local session_opts = { cookie = { domain = ".mydomain.com" } }

Start

docker-compose up --build

Allow time for container startup and Keycloak DB initialization. Initial start may take a minute. No special sync for start; if it hangs, check logs:

docker-compose logs -f

Restart if needed:

docker-compose restart

Keycloak

Setup in Keycloak:

  1. Access Keycloak admin console at http://localhost:3333 (credentials in docker-compose.yml).
  2. Create realm imagingrealm (top left, "Add realm" in dropdown).
  3. Create client imaging:
    • Redirect URL: *
    • access-type: confidential
    • Web Origins: +
  4. Add secret key from Keycloak user PACS Credentials to openid-keycloak-secrets.env, var OPENID_CLIENT_SECRET.
  5. Create a user, set password in Credentials, to access nginx protected resources with OpenIDC.
  6. Restart nginx to apply new secret key.
docker-compose stop viewer
docker-compose up -d

Links

SSL Key

SSL key included for development. DO NOT USE in production. Secret key is public in this repo.

Regenerate for production:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginxenv/ssl/nginx.key -out nginxenv/ssl/nginx.crt

openidc-ohif-orthanc's People

Contributors

andgineer avatar

Watchers

 avatar  avatar

Forkers

yuhxuiao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.