Code Monkey home page Code Monkey logo

Comments (6)

axelssonHakan avatar axelssonHakan commented on September 10, 2024

Hi

Sorry for the late answer. I have tried the linked tutorial, and I'm able to connect to a QCS app after adding the host to web-integration (in my case https://127.0.0.1:8080)

Do you have any example code you can share?
What kind of devServer are you using?

from enigma.js.

mattkizaric-leveragelab avatar mattkizaric-leveragelab commented on September 10, 2024

@axelssonHakan We are using firebase's hosting emulator for local development. As for our frontend web framework, we are using React. Our team has been able to log in successfully with qlik as shown above, however even when we whitelist our dev domain for the web-integration we are unable to connect via websockets to our qlik domain.

In Chrome Console:

const webIntegrationId = ""
const csrfToken = ""
const appId = ""
const tenantUri = ""
let wsurl = `${tenantUri.replace(
      'https',
      'wss'
    )}app/${appId}?qlik-web-integration-id=${webIntegrationId}&qlik-csrf-token=${csrfToken}`
new WebSocket(wsurl);

It's my understanding that similar code is called by enigma here. I have verified that calling the enigma library leads to the same result as the above code.

Could you see if the above snippit works for you in the developer console? We have a temporary solution right now with embedded sheets, so I was able to verify that this worked in the domain context of our qlik saas tenant.

from enigma.js.

axelssonHakan avatar axelssonHakan commented on September 10, 2024

I just installed the hosting emulator and it seems fine to "integrate" the tutorial you mentioned.
Screenshot 2021-03-25 at 09 32 51

I'm using the config from the tutorial:

  try {
    // fetch the CSRF token:
    const res = await request('/api/v1/csrf-token', false);
    const csrfToken = res.headers.get('qlik-csrf-token');

    // fetch the list of available apps:
    const apps = await request('/api/v1/items?resourceType=app');

    if (!apps.data.length) {
      titleElement.innerHTML = 'No apps available';
      return;
    }

    // grab the first app id in the list:
    const appId = apps.data[0].resourceId;

    // build a websocket URL:
    const url = `${tenantUri.replace(
      'https',
      'wss'
    )}/app/${appId}?qlik-web-integration-id=${webIntegrationId}&qlik-csrf-token=${csrfToken}`;

    // fetch the engine API schema:
    const schema = await (
      await fetch('https://unpkg.com/[email protected]/schemas/12.612.0.json')
    ).json();

    // create the enigma.js session:
    const session = window.enigma.create({ url, schema });
    const global = await session.open();

    // open the app, and fetch the layout:
    const app = await global.openDoc(appId);
    const appLayout = await app.getAppLayout();

    // finally, present the app title in your web app:
    titleElement.innerHTML = appLayout.qTitle;
  } catch (err) {
    window.console.log('Error while setting up:', err);
  }

from enigma.js.

mattkizaric-leveragelab avatar mattkizaric-leveragelab commented on September 10, 2024

@axelssonHakan Hmmm I'll test this over the weekend and post my findings. What version of chrome are you on? I know with recent updates with cookies, we have issues with incognito browsers not authenticating end users. Our whitelabed solution is using JWT authentication and maybe the qlik cookies are not being passed with the request.

from enigma.js.

mattkizaric-leveragelab avatar mattkizaric-leveragelab commented on September 10, 2024

@axelssonHakan I went back and did the tutorial again. My issue was as a tenant admin I am able to see all apps across spaces, but I was not explicitly added to the space of the app i wanted to connect to. Interestingly, I am able to embed an iframe and calling the Qlik api while in our Saas UI via the browser console worked fine regardless of my space access. That does not seem to be related to enigma, but I appreciate your timely responses. Closing this issue.

from enigma.js.

axelssonHakan avatar axelssonHakan commented on September 10, 2024

Thanks for responding with updated status

from enigma.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.