Keycloak-angular: Initialization error after login on Microsoft Edge

Created on 29 Aug 2018  路  14Comments  路  Source: mauriciovigolo/keycloak-angular

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search for issues before submitting
- [ ] feature request

Versions.

Keycloak v3.1.0.Final
Keycloak-Angular (angular6-keycloak3) v.3.0.2
Angular v6.1.4
Angular CLI v6.1.5

Microsoft Edge 42.17134.1.0
Windows 10 v1803 (build 17134.228)

Repro steps.

  • Using example 'keycloak-heros'
  • Using Keycloak base installation.
  • Updating the 'keycloak-heros' keycloakConfig in environment to match.
  • Using Microsoft Edge on Windows.
  • On loading the app, the screen redirects to Keycloak, I authenticate, and then it redirects back to the app.

The log given by the failure.

ERROR An error happened during Keycloak initialization.

Desired functionality.

Currently shows a blank screen in Microsoft Edge 42 after successful login.

That's all I get in the log, on trying to throw errors at that point I get problems with adding the error, with the Keycloak instance effectively being null. This is around line 200 of keycloak.service.ts. Although logging it to the console shows its methods (I assume from the typings).

I've spent a couple days trying different things, I don't think it's CORS, I don't think it's caching. On trying to debug with Edge the 'token' request comes through without information. My thinking is that Angular isn't properly initialised before it fires off the token request, and that the module that comes from keycloak-js-bower isn't making its way through properly.

I'm really stuck with this one, I've tried to get to the stage where I can debug (or 'console.log'...) into the keycloak-js-bower repo but without success.

I would also like to give my thanks to the team for your continued hard work and responsiveness. I've previously raised an issue here and was updated very promptly!

Any other help I can provide I will be glad to try with some direction.

Many thanks

Question

Most helpful comment

I encountered this problem on live server only. It works almost fine in localhost (this bug pops up once in a while)

Edit (07/01/2019): After doing some more experiments, Edge generates this error when:

  • The client is deployed locally and the Keycloak server is deployed on live server (without certificate)
  • Both the client and Keycloak server are deployed on live servers but both using self-signed certificates.

It seems Edge has some default security policy that prevents Keycloak iframe from being loaded from untrusted source.

All 14 comments

Hi @jngutteridge, I will try to reproduce this error today and help you. Thanks for reporting!

@jngutteridge, I reproduced this error at work with the following versions:

  • RedHat Single SignOn 7.x.
  • Windows 10
  • Edge 41.

The funny thing is that at home I couldn't reproduce this scenario.
Home environment:

  • Keycloak 3.1.0 and 4.1.0,
  • Keycloak-angular 3.0.2 and 4.0.0.
  • Windows 10
  • Microsoft Edge 42.17134.1.0
    With this config at home, Edge is working correctly.

Did you try with a newer version of keycloak, for example 4.3.0? You could try it with the docker official image. If it works, is a keycloak server update an option for you? The newest version of keycloak has lots of improvements.

I will try again tomorrow at work, as we currently use Edge and RedHat Single Sign-On, so this is an issue for us also.

@mauriciovigolo thank you for your prompt feedback!

A Keycloak 4 upgrade is on the cards for us, I'll ask my manager if we can push this forward. We face a bit of difficulty as we have several apps using the same Keycloak server, various in-house plugins, and many themes for various tenants that wouldn't work given the new version without some alteration.

It might be we have to push forward with this. I'll keep track of the issue though.

Thanks again.

Great @jngutteridge! Just before going to this option give it a try on your machine or in a sandbox. I will also try it at work. Thanks!

Same here:
Keycloak-angular 4.0.0
Microsoft Edge 40.15063.674.0

I have the same problem:
Edge: 42.17134.1.0
Keycloak-angular: 3.0.1, 3.0.2, 4.0.0, 4.0.2
Keycloak: 4.1.0

It does work in all other browsers EVEN in Internet Explorer 11 (11.345.17134.0)

Update:
I put my application on our intranet and it works, so it doesn't for localhost..

Update:
I put my application on our intranet and it works, so it doesn't for localhost..

We've the same problem with localhost. All other deployed instances works fine 馃憤

I encountered this problem on live server only. It works almost fine in localhost (this bug pops up once in a while)

Edit (07/01/2019): After doing some more experiments, Edge generates this error when:

  • The client is deployed locally and the Keycloak server is deployed on live server (without certificate)
  • Both the client and Keycloak server are deployed on live servers but both using self-signed certificates.

It seems Edge has some default security policy that prevents Keycloak iframe from being loaded from untrusted source.

Any news? We are facing the same issue.

Angular: v7
Keycloak-Angular: v6
Keycloak: 4.4

Hi @barrynorman, could you tell me if your environment is the same as @trung674?

I had the same issue some time ago when using a self signed certificate. I did some research at the Keycloak's jira and all I found was this, but I'm not sure if it is related. I will try to reproduce this error with a keycloak.js example without angular.

Thanks @mauriciovigolo !
Currently we are working in our internal environments with self signed certificates.

Let me check first if its working with "real" certs.

@barrynorman @trung674 Did you manage to reproduce the issue and validate that this was indeed the problem?

Closing this issue due to unresponsiveness and the death of Edge.

Was this page helpful?
0 / 5 - 0 ratings