qlik-demo-team / qdt-components

React Components to be used with Angular 10, React 16 and Vue 2. Connects with the Capability API and Engine API.
MIT License
92 stars 50 forks source link

Header authentication #39

Closed miranda-elliott closed 5 years ago

miranda-elliott commented 5 years ago

I want to use header authentication with qdt-components. I have the virtual proxy prefix in the config, but how do I pass the user header and xrf-key header and URL parameter with each call (like in this example)? I don't see any documentation around this. Thank you.

fkabinoff commented 5 years ago

You don't pass the user header and xrf-key with websocket requests from the browser. What you have to do instead is make a request to a REST endpoint (I use 'qps/user') and pass the user header with that before qdt-components creates any websocket connections. That REST endpoint request will return a set-cookie header and set a cookie that will be passed with every websocket request.

ollystephens1 commented 5 years ago

I am also trying to authenticate following the instructions here, which when run with Postman returns a Set-Cookie with my custom proxy etc.

I am running this request on startup in my Angular app, but I am getting a number of different errors:

Cannot read property 'config' of undefined

'Please specify a qConfig global variable' error

Could anyone please provide some instructions as to how to actually authenticate through Angular?