wip redirect on landing page and logout to oidc provider

This commit is contained in:
viehlieb 2022-05-11 09:05:43 +02:00
parent b97c51abde
commit 2e354f9b1e
7 changed files with 92 additions and 15 deletions

View file

@ -7,11 +7,14 @@ if (Meteor.isClient) {
callback = options;
options = null;
}
console.log(options.loginStyle);
console.log(callback);
var credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback);
console.log("credentialCallback",credentialRequestCompleteCallback);
Oidc.requestCredential(options, credentialRequestCompleteCallback);
};
} else {
}
else {
Accounts.addAutopublishFields({
// not sure whether the OIDC api can be used from the browser,
// thus not sure if we should be sending access tokens; but we do it

View file

@ -7,6 +7,8 @@ Oidc = {};
// error.
Oidc.requestCredential = function (options, credentialRequestCompleteCallback) {
// support both (options, callback) and (callback).
console.log("from client");
console.log(options);
if (!credentialRequestCompleteCallback && typeof options === 'function') {
credentialRequestCompleteCallback = options;
options = {};
@ -55,13 +57,14 @@ Oidc.requestCredential = function (options, credentialRequestCompleteCallback) {
width: options.popupOptions.width || 320,
height: options.popupOptions.height || 450
};
OAuth.launchLogin({
loginService: 'oidc',
loginStyle: loginStyle,
loginUrl: loginUrl,
credentialRequestCompleteCallback: credentialRequestCompleteCallback,
credentialToken: credentialToken,
popupOptions: popupOptions,
});
OAuth.saveDataForRedirect(options.loginService, options.credentialToken);
Accounts.oauth.tryLoginAfterPopupClosed(credentialToken, credentialRequestCompleteCallback);
// OAuth.launchLogin({
// loginService: 'oidc',
// loginStyle: loginStyle,
// loginUrl: loginUrl,
// credentialRequestCompleteCallback: credentialRequestCompleteCallback,
// credentialToken: credentialToken,
// popupOptions: popupOptions,
// });
};

View file

@ -19,7 +19,8 @@ var serviceData = {};
var userinfo = {};
OAuth.registerService('oidc', 2, null, function (query) {
console.log(Date.now());
console.log("query: ", query);
var debug = process.env.DEBUG || false;
var token = getToken(query);