Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.
I'm working on a project that integrates an Angular SPA with a MSSql db back-end and Qlik Sense (Nov 19). I'm using Okta for my IDP and have it set up as follows:
Okta sign-in widget on SPA login page. User logs in and following this my SPA communicates with my db APIs by sending a JWT Authorization bearer token that was generated by Okta on login. I've set up my db to validate the incoming token to provide access and set the db user. This validation is done remotely via Okta's provided method, and this is all working great.
My challenge is to now integrate Qlik with this ecosystem, and I believe that I should be able to set up a JWT virtual proxy to receive the same token that Okta generated. Okta does not provide a public key certificate in PEM format for me to use in setting up the virtual proxy, but they do provide a JWKS that looks like the following example:
I can convert this to a PEM certificate, however Qlik rejects it with the error message that the certificate is invalid.
I'm aware that there is an out-of-the-box method for integrating Qlik and Okta, however there is a specific reason for using JWT rather than SAML in this case.
Any help in setting up a virtual proxy to receive and validate the bearer token from Okta would be greatly appreciated!
Thanks for the reply.
That's not going to work, unfortunately, because Okta will not use the private key provided by Qlik to generate the token. The token is generated by Okta, and the public key certificate is needed to validate it.
Did you try this method?
try this steps if it will helps you 🙂
I've been in contact with Okta and can confirm that the certificate generated from the JWKS is valid. I've been able to test that the token and public key certificate are both valid by verifying them on jwt.io and can confirm that the algorithm is RS256, which is supported by Qlik.
Everything works great up to this point, however Qlik is still showing the 'Invalid Public Key Certificate' error when the certificate is entered in the virtual proxy configuration screen.
I can't see a reason for Qlik to be refusing to accept the certificate, since it can be confirmed as valid by jwt.io and will successfully decode and validate the payload of the bearer token.
i dont have any idea but when i was trying to connect with qlik using nodejs that time i have to pass certificates also we have to add one header called certificate = NULL.
so try with your method put certificates = Null, if you have this type of option.
might work for you 🙂
Hi all. I see that we have the same expectations about making Qlik work with JWT authentication. We made it so I'm sharing the solution, hoping it will help you.
The different examples that you can find on the web are using the Qlik server's certificate for signing the JWT. It's quite confusing ... You have to use the certificate provided by your IdP. You can get it from the discovery mechanism provided by OIDC protocol. Here are the steps :
- Open the discovery page of your IdP :
- The response is a json. Look at the jwks_uri field, and go to this uri. In my case : https://your.idp.server/.well-known/openid-configuration/jwks but could be different for you).
- The response is another json describing the keys used for signing the JWT. The specification (JWK) is here : https://tools.ietf.org/html/rfc7517#section-4. It's the same content of what received @frank_packer_at at the top of this topic.
- The public certificate used to sign the JWT should be provided in the x5c attribute (for me, at least ...). Following the specification, it's a base_64 encoded DER binary file. From this string, you can create the file with some tools, for example on linux I'm doing this (some tools should be available in Windows, I'm not very familiar with the Windows console) :
echo 'MII...your...certificate...base64...string' | base64 -d > idp.der
- You can check that the certificate is ok :
openssl x509 -inform der -in idp.der -text -noout
- Then convert the DER binary file to a PEM format :
openssl x509 -inform der -in idp.der -out idp.pem
- Paste the content of this PEM file in the JWT Virtual Proxy configuration in Qlik, and it should work.
- To be able to check that everything is OK, you can extract the public key from the certificate and paste it on jwt.io to check the signature of your JWTs. For this, get the pub file and paste the content on jwt.io :
openssl x509 -pubkey -noout -in idp.pem > idp.pub
- After this, you have to configure the claims in which Qlik should read the userId and directoryId, and the value of the aud claim (Audience) that Qlik should check to allow the JWT. Once the user is authenticated by the proxy, you should provide him for a license. For this you can rely on the claims (attribute mapping in the Virtual Proxy) or on other attributes if you synchronize the directory with UDC (which is not mandatory, as Qlik creates the users in the directory when they authenticate).
Hope this helps !