feat(keycloak) Optional Keycloak integration via OpenId Connect (OIDC) for Identity and Access Management (#227)
This commit is contained in:
1 parent
03d0798459
commit
33755f7b8b
25 files changed
+294
-11
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Router } from 'meteor/clinical:router';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Router.waitOn(function() {
|
||||
return [
|
||||
Meteor.subscribe('user.services.keycloak'),
|
||||
];
|
||||
}, { except: ['userLogin'] });
|
||||
|
||||
Router.onBeforeAction(function() {
|
||||
// Check if user is signed in
|
||||
if (!Meteor.userId() && !Meteor.loggingIn()) {
|
||||
this.redirect('userLogin');
|
||||
} else {
|
||||
this.next();
|
||||
}
|
||||
}, {
|
||||
except: ['userLogin', 'entrySignUp', 'forgotPassword', 'resetPassword']
|
||||
});
|
||||
|
||||
OHIF.user.additionalLoginButtons = OHIF.user.additionalLoginButtons || [];
|
||||
|
||||
OHIF.user.additionalLoginButtons.push({
|
||||
template: 'keycloakLoginButton'
|
||||
});
|
||||
|
||||
if (!Meteor.settings.public.userAuthenticationRoutesEnabled) {
|
||||
OHIF.log.error('Please set Meteor.settings.public.userAuthenticationRoutesEnabled=true');
|
||||
}
|
||||
Reference in new issue
Block a user