Clean up oidc config

This commit is contained in:
dannyrb 2019-05-07 15:42:11 -04:00
parent aa768c7fd4
commit f495ccfa3f
4 changed files with 15 additions and 44 deletions

View File

@ -79,7 +79,7 @@
"ohif-dicom-microscopy-extension": "^0.0.5",
"ohif-dicom-pdf-extension": "^0.0.6",
"ohif-vtk-extension": "^0.0.1",
"oidc-client": "^1.6.1",
"oidc-client": "1.7.x",
"prop-types": "^15.6.2",
"react-bootstrap-modal": "^4.2.0",
"react-dnd": "^7.0.2",
@ -91,7 +91,7 @@
"react-viewerbase": "0.3.2",
"react-vtkjs-viewport": "^0.0.7",
"redux": "^4.0.1",
"redux-oidc": "^3.1.0"
"redux-oidc": "3.1.x"
},
"devDependencies": {
"@babel/core": "^7.2.2",

View File

@ -10,9 +10,6 @@ window.config = {
wadoUriRoot: 'http://127.0.0.1/pacs/wado',
qidoRoot: 'http://127.0.0.1/pacs/dicom-web',
wadoRoot: 'http://127.0.0.1/pacs/dicom-web',
// wadoUriRoot: 'http://localhost:8899/wado',
// qidoRoot: 'http://localhost:8899/dicom-web',
// wadoRoot: 'http://localhost:8899/dicom-web',
qidoSupportsIncludeField: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
@ -27,26 +24,15 @@ window.config = {
},
oidc: [
{
authServerUrl: 'http://127.0.0.1/auth/realms/master',
// It looks like we have this route hardcoded in `OHIFStandaloneViewer.js`
authRedirectUri: '/callback', // backup: /studylist\
// Also hardcoded?
postLogoutRedirectUri: '/logout-redirect.html',
responseType: 'id_token',
scope: 'openid',
clientId: 'pacs',
// ~ REQUIRED
// Authorization Server URL
authority: 'http://127.0.0.1/auth/realms/master',
client_id: 'ohif-viewer',
redirect_uri: '/callback', // `OHIFStandaloneViewer.js`
response_type: 'id_token',
scope: 'openid', // email profile openid
// ~ OPTIONAL
post_logout_redirect_uri: '/logout-redirect.html',
},
// ccc.js
// {
// authRedirectUri: "http://localhost:5000/callback",
// postLogoutRedirectUri: "http://localhost:5000/logout-redirect.html",
// responseType: "id_token token",
// scope: "email profile openid",
// revokeAccessTokenOnSignout: true,
// extraQueryParams: {
// kc_idp_hint: "crowds-cure-cancer-auth0-oidc",
// client_id: "crowds-cure-cancer"
// }
// }
],
}

View File

@ -4,6 +4,7 @@ import { loadUser, createUserManager } from 'redux-oidc'
/**
* Creates a userManager from oidcSettings;
* loads the user into the provided redux store
* LINK: https://github.com/IdentityModel/oidc-client-js/wiki#configuration
*
* @param {*} store
* @param {Object} oidcSettings
@ -19,29 +20,13 @@ export default function(store, oidcSettings) {
return
}
const {
authServerUrl,
clientId,
authRedirectUri,
postLogoutRedirectUri,
responseType,
extraQueryParams,
} = oidcSettings
const settings = {
authority: authServerUrl,
client_id: clientId,
redirect_uri: authRedirectUri,
...oidcSettings,
silent_redirect_uri: '/silent-refresh.html',
post_logout_redirect_uri: postLogoutRedirectUri,
response_type: responseType,
// Note: Request must have scope 'openid' to be considered an OpenID Connect request
scope: 'email profile openid',
automaticSilentRenew: true,
revokeAccessTokenOnSignout: true,
filterProtocolClaims: true,
loadUserInfo: true,
extraQueryParams: extraQueryParams,
}
const userManager = createUserManager(settings)

View File

@ -9661,7 +9661,7 @@ ohif-vtk-extension@^0.0.1:
classnames "^2.2.6"
react-vtkjs-viewport "^0.0.7"
oidc-client@^1.6.1:
oidc-client@1.7.x:
version "1.7.1"
resolved "https://registry.yarnpkg.com/oidc-client/-/oidc-client-1.7.1.tgz#8b9d8d50fd7f878968b1cda17712c1747eef9a54"
integrity sha512-qsPBQVa/BY6AmdY89erANJbfDXrX1dqu9lKgvYZzkVDzIj5mmw6wGjFeQuV2HDm4TiJA0VT5HSTWOWnXZUYu0g==
@ -11988,7 +11988,7 @@ redeyed@~2.1.0:
dependencies:
esprima "~4.0.0"
redux-oidc@^3.1.0:
redux-oidc@3.1.x:
version "3.1.2"
resolved "https://registry.yarnpkg.com/redux-oidc/-/redux-oidc-3.1.2.tgz#31a771b0e05a65879626262e1e63ba70a0936ffd"
integrity sha512-1kwm3SxzgUg4h1oFpPOOzofKyWJvwhVJ3BHnm/d+h29NjZ4BF3wfJbpdubnPUF0lMrl6KNOJTz8rVlkacj+f4g==