feat(openid-connect): Switch to generic OIDC Client library instead of using Keycloak.js (#273)

This commit is contained in:
Erik Ziegler authored and GitHub committed 2018-09-19 14:50:12 +02:00
1 parent 2f05ed5961
commit 18bcf83805
70 files changed
+572 -655

No files matched your search

@@ -31,7 +31,7 @@ Template.ohifViewer.onCreated(() => {
icon: 'fa fa-info'
}];
if (Meteor.user()) {
if (OHIF.user.userLoggedIn() === true) {
headerItems.push({
action: OHIF.user.logout,
text: 'Logout',
@@ -32,7 +32,7 @@ body>.header
.menu-toggle
display: inline-block
height: 18px
.research-use
font-size: 13px
theme('color', '$textSecondaryColor')
@@ -62,7 +62,6 @@ body>.header
.brand
height: 100%
width: 80%
line-height: $topBarExpandedHeight - 10px
.logo-image
-8
View File
@@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
import { cornerstoneWADOImageLoader } from 'meteor/ohif:cornerstone';
import { Accounts } from "meteor/accounts-base";
Meteor.startup(function() {
const maxWebWorkers = Math.max(navigator.hardwareConcurrency - 1, 1);
@@ -23,17 +22,10 @@ Meteor.startup(function() {
cornerstoneWADOImageLoader.configure({
beforeSend: function(xhr) {
const userId = Meteor.userId();
const accessToken = OHIF.user.getAccessToken();
if (accessToken) {
xhr.setRequestHeader("Authorization", `Bearer ${accessToken}`);
} else {
const loginToken = Accounts._storedLoginToken();
if (userId && loginToken) {
xhr.setRequestHeader("x-user-id", userId);
xhr.setRequestHeader("x-auth-token", loginToken);
}
}
}
});
+15 -6
View File
@@ -5,12 +5,21 @@ Router.configure({
layoutTemplate: 'layout',
});
Router.waitOn(function() {
return [
Meteor.subscribe('servers'),
Meteor.subscribe('currentServer')
];
});
// If we are running a disconnect client similar to the StandaloneViewer
// (see https://docs.ohif.org/standalone-viewer/usage.html) we don't want
// our routes to get stuck while waiting for Pub / Sub.
//
// In this case, the developer is required to add Servers and specify
// a CurrentServer with some other approach (e.g. a separate script).
if (Meteor.status().connected === true) {
Router.waitOn(function() {
return [
Meteor.subscribe('servers'),
Meteor.subscribe('currentServer')
];
});
}
Router.onBeforeAction('loading');