APIs & Integrations

okangul
Participant

Trouble Passing User cookie to CRM Card Iframe

SOLVE

We have a button in our custom CRM Card that opens up a page in our actual system in an IFRAME. The problem that we are having is, even the user is logged into our system in the browser the IFRAME shows them not logged in. So I believe the user cookie is not passed to the IFRAME, it used to work when we first published our app but it suddenly stop working, can anybody help us figure this out?

0 Upvotes
1 Accepted solution
hilton22
Solution
Contributor | Elite Partner
Contributor | Elite Partner

Trouble Passing User cookie to CRM Card Iframe

SOLVE

Hi @okangul,

 

If I understood correctly, the problem here is log you user in you app, once this user load the object page (contact, deal, ticket etc) containing the widget/CRM card, right?

 

Ok... I believe that you will have a problem working with hubspot cookies and iframes... those two thing doesn't work very well together... 😞

 

My sugestion here for you, is work with the request that Hubspot make to your application. At the very moment that your CRM card is loaded on the Hubspot page, Hubspot send to your app a request (GET) to the endpoint that you provided, to load the card in the Hubspot page.

Hubspot add some parameters in this endpoint of yours, like the ID and e-mail of the hubspot user that is trying to load the CRM card, for exemple. 

 

Maybe you can use this parameters to log your user in.

 

You can have more information in this documentation here in the "Data fetch request " section.

 

I hope I've helped.

 

Cheers,

View solution in original post

3 Replies 3
hilton22
Solution
Contributor | Elite Partner
Contributor | Elite Partner

Trouble Passing User cookie to CRM Card Iframe

SOLVE

Hi @okangul,

 

If I understood correctly, the problem here is log you user in you app, once this user load the object page (contact, deal, ticket etc) containing the widget/CRM card, right?

 

Ok... I believe that you will have a problem working with hubspot cookies and iframes... those two thing doesn't work very well together... 😞

 

My sugestion here for you, is work with the request that Hubspot make to your application. At the very moment that your CRM card is loaded on the Hubspot page, Hubspot send to your app a request (GET) to the endpoint that you provided, to load the card in the Hubspot page.

Hubspot add some parameters in this endpoint of yours, like the ID and e-mail of the hubspot user that is trying to load the CRM card, for exemple. 

 

Maybe you can use this parameters to log your user in.

 

You can have more information in this documentation here in the "Data fetch request " section.

 

I hope I've helped.

 

Cheers,

okangul
Participant

Trouble Passing User cookie to CRM Card Iframe

SOLVE

Hi @dennisedson 

Thanks for your reply. There isn't any specific error, the server just returns HTTP 401 because of the lack of user information even I am logged into the system with my admin account in the same browser.Screen Shot 2021-03-18 at 11.58.15 AM.png

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Trouble Passing User cookie to CRM Card Iframe

SOLVE

Hi @okangul 

Are you getting any error messages? 

Adding a few people to the conversation.

@SamKreeke , @EkramulHuq , @Ali7 , @hilton22 , @catalinsendsms  can any of you offer some help 😀

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show
0 Upvotes