I'm a bit stumped on this one. My goal is to use the help centre articles api to display an article inline/embedded in our existing web site and I'm very close to having this working. What I have so far is:
- jwt SSO setup and working.
- secure GET of a specific article using OAUTH2 tokens
- displaying the body of the article on our site
The only thing I'm struggling with is display of images. IF the user has already signed into zendesk, it works fine. If they have not, then I'm getting a 404 back when requesting the image. No problem, I thought, it'll be because I'm missing some cookies. So I ensured our web app and our zendesk were running on the same domain and then I programictially called POST `[zendesk]/access/jwt`, intercepted the response headers, extracted the value of `_zendesk_shared_session` and set it on our app via a response from our auth service. The cookie is now being sent along with the request for the image.......still 404.
I believe the reason for this is that POST `[zendesk]/access/jwt`, whilst responding with the session cookie I need is NOT establishing a server side session - as proven by calling `[zendesk]/api/v2/sessions` - which does not list anything with my programatic method, but does if I log in manually. I am assuming that after zendesk processes the request to POST `[Zendesk]access/jwt` another redirect is performed which then DOES establish the server side session.
So, my question: is there anyway I can mimic the manual auth flow in order to create the server side session that then corresponds to the session identified by the `_zendesk_shared_session` cookie.
Or is there another approach for me to seamlessly (not require the user to login twice, even if with the same credentials), that will allow me to display an image hosted on my zendesk help centre within/embedded in my web app?
Any help would be much appreciated!
Please sign in to leave a comment.