From c9fcedb2477105e2e1f9435f02a9317f403a030c Mon Sep 17 00:00:00 2001 From: dannyrb Date: Mon, 6 May 2019 16:01:45 -0400 Subject: [PATCH] Begin laying out keycloak configuration --- docker/OpenResty-Orthanc-Keycloak/README.md | 25 ++------- .../recipes/user-account-control.md | 55 ++++++++++++++++++- 2 files changed, 58 insertions(+), 22 deletions(-) diff --git a/docker/OpenResty-Orthanc-Keycloak/README.md b/docker/OpenResty-Orthanc-Keycloak/README.md index cef3f57db..1a719612a 100644 --- a/docker/OpenResty-Orthanc-Keycloak/README.md +++ b/docker/OpenResty-Orthanc-Keycloak/README.md @@ -29,27 +29,6 @@ https://github.com/maxmantz/redux-oidc - Set admin user/pass in `docker-compose` - What are realms? -- Configure Clients - - Create client - - ClientID: `pacs`; save - - Details page - - Client Protocol: `openid-connect` - - AccessType: `Confidential` - - Picking a grant type: - https://auth0.com/docs/api-auth/which-oauth-flow-to-use - - Standard Flow: `off` - - Implicit Flow: `on` - - Direct Access: `off` - - Root URL: `http://127.0.0.1` - - Valid Redirect URIs: `/studylist/*` - - Web Origins: `*` - - Credentials Tab - - Copy `secret` -- Manage: Users - - Add User - - Username: `test` - - Credentials Tab - - Password: `test` ## Useful Commands @@ -66,6 +45,10 @@ Interact w/ running container: 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 diff --git a/docs/latest/deployment/recipes/user-account-control.md b/docs/latest/deployment/recipes/user-account-control.md index 2cb2f6e8d..c496f8fbf 100644 --- a/docs/latest/deployment/recipes/user-account-control.md +++ b/docs/latest/deployment/recipes/user-account-control.md @@ -48,7 +48,58 @@ in command prompt or terminal_ ## Getting Started -... +1. Navigate to `/docker/OpenResty-Orthanc-Keycloak` in your shell +2. Run `docker volume create --name=keycloak_postgres_data` +3. Run `docker-compose build` +4. Run `docker-compose up` + +### Create a new "Client" in Keycloak + +- What is a realm? +- What is a client? +- OAuth 2.0 and implict flow; why? +- Can we set all of this up via config instead of manual? + +- Navigate to `http://127.0.0.1/auth/admin/` in your browser. You should see: + + + +- Sign in with `admin`/`password` +- Configure: Clients --> Create Client + - ClientID: `pacs` + - Client Protocol: `openid-connect` + - Click "save" +- Under our new client's `Settings` tab: + - Client Protocol: `openid-connect` + - AccessType: `Confidential` + - Standard Flow: `off` + - Implicit Flow: `on` + - Direct Access: `off` + - Root URL: `http://127.0.0.1` + - Valid Redirect URIs: `/callback*` + - Web Origins: `*` + - Click "save" +- Select the "Credentials" Tab + - Copy the `secret` value and save it for later +- From the left hand sidebar, select `Users` + - Click "Add User" + - Username: `test` + - Email Verfied: `ON` + - Click "Save" + - Select the "Credentials" Tab + - New Password: `test` + - Password Confirmation: `test` + - Temporary: `OFF` + - Click "Reset Password" + +### Rebuild Client + +- Set in `config/nginx.conf`? + - Env variable??? + - `2dc6244a-1cba-4dbd-b3d6-f7409c2f68b3` +- stop, `docker-compose up` + +### Configuration ## How it works @@ -94,6 +145,8 @@ The inspiration for our setup was driven largely by these articles: For more documentation on the software we've chosen to use, you may find the following resources helpful: +- [Clientside library we use to manage OpenID-Connect `implicit` flow](https://github.com/maxmantz/redux-oidc) - [Orthanc for Docker](http://book.orthanc-server.com/users/docker.html) - [OpenResty Guide](http://www.staticshin.com/programming/definitely-an-open-resty-guide/) - [Lua Ngx API](https://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/) +- [Auth0: Picking a Grant Type](https://auth0.com/docs/api-auth/which-oauth-flow-to-use)