Hello,
we have a Angular4 web application running with keycloak.js that works
great.
We are now trying to put this application into a cordova container running
on iOS, but in the login function of the keycloak cordova adapter
var loginUrl = kc.createLoginUrl(options);
var ref = window.open(loginUrl, '_blank', o);
ref is always null, so adding the event listener fails ?!?
We are bootstrapping (main.ts) our angular application like this:
function bootstrapKeyCloak() {
KeycloakService.init({
'url': environment.keycloakConfig.url,
'realm': environment.keycloakConfig.realm,
'clientId': environment.keycloakConfig.clientId,
}, {
onLoad: 'login-required',
flow: 'standard'
}).then(() => {
platformBrowserDynamic().bootstrapModule(AppModule);
}).catch((e: any) => {
alert(e);
});
}
if (typeof window['cordova'] !== 'undefined') {
if(document) {
document.addEventListener('deviceready', () => {
bootstrapKeyCloak();
}, false);
}
} else {
bootstrapKeyCloak();
}
Any ideas why window.open fails and how to fix this?
--
Kind Regards,
Jens Schliesser
Show replies by date