Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-19690

Keycloak JavaScript client does not work without options in init method

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Adapter - JavaScript
    • NEW
    • NEW

    Description

      Description :

      Since the following commit (https://github.com/keycloak/keycloak/commit/17b374f53af275099f93a2d5c0bf13614cc11b8f) the example provided in the documentation is not working (ref https://www.keycloak.org/docs/latest/securing_apps/index.html#_javascript_adapter) :

       

      function initKeycloak() {
                  var keycloak = new Keycloak();
                  keycloak.init().then(function(authenticated) {
                      alert(authenticated ? 'authenticated' : 'not authenticated');
                  }).catch(function() {
                      alert('failed to initialize');
                  });
              }

       

      The absence of init options in the keycloak.init method makes the "kc.messageReceiveTimeout" to be undefined. it raises a "Timeout when waiting for 3rd party check iframe message." error even if the promise in check3pCookiesSupported is resolved (setSuccess method). Passing an empty object in the init method (ex :  keycloak.init({}) ) fix the issue.

       

      How to reproduce :

       

      Proposal :

      I see two possible solutions :

      • the "messageReceiveTimeout" should be initialized, even if no init options are provided
      • Make the init options mandatory and update the documentation

       

      Regards

      Attachments

        Activity

          People

            Unassigned Unassigned
            d.maurin@groupeonepoint.com David Maurin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: