Use Knowledge Base login identity for authentification in 3rd party app

Hi there,

we use restricted knowledge base pages to create a distributor portal. We now need to provide data from other databases to our distributors. For that we would like to put links to said 3rd party pages into the knowledge base. However, we need to make them private too. We want to avoid creating two logins for distributors. So somehow we need to reuse the identity they have in the knowledge base.

Is there any way for the 3rd party app to recognize the Hubspot KB access level and if the user is logged in? For example by looking at the cookie of the user?

On a side note: Would be nice if Hubspot could handle something like Auth0 for users (or google logins for that matter).

Thanks for any help

Hi, @basil.

Sincere apologies for the delayed response.

At this time, I can’t think of a good way to avoid a second login prompt.

First off, I’m not sure if or how granular knowledge base access data is stored in HubSpot’s cookies. Second, while cookies can pass between domains with cross-domain linking, it requires your tracking code to be placed on the destination site.

If you do have the ability to modify these external sites, you could pursue some of the highly technical workarounds described here and here, however I’m still not certain how you would distinguish between the knowledge base access of visitors.

Perhaps you could use the hubspotutk cookie to query this endpoint and check their list-memberships array. for list IDs corresponding to the access level on the page. Query parameters may be another way to pass information between domains.
All this said, I do see value in some kind of auth system for HubSpot users. I recommend searching the Community Ideas Forum and upvoting and commenting on similar requests. If you end up posting a new feature request, share it below and I’ll be happy to upvote it as well.

Thanks a lot for the reply. We will have a look into it!

Hi @IsaacTakushi ,

we finally had time to look into this. Now, if I manually do this process, I do suceed. I do the following:

  1. I use the inspector to see the stored cookies when being on our webpage. It shows me a hubspotutk value.
  2. I then use the described api call to get the contact info. From there I have the identity and can check everything I need.

Now my problem is, that I cannot reproduce these results in a google script. Could you give advice how we could read the hubspotutk value there? We already have the hubspot tracking code in our apps.

Any help is highly appreciated.

Hi, @basil.

Thanks for reaching back out! Apologies for the delayed response.

To clarify, by “Google script,” are you looking to retrieve the hubspotutk cookie value with Google Tag Manager for use in a tag?

If so, Google Tag Manager has a 1st party cookie variable which you can use to capture the hubspotutk value.

I just tested and confirmed this method by:

  1. Creating a custom 1st party cookie variable referencing the hubspotutk cookie. I named the variable HubSpot-UTK.
  2. Creating a custom HTML tag containing the code below.
  3. When triggered (in my case by a page view), the hubspotutk value was logged to the console.
<script>
 console.log("Isaac's custom GTM tag. The value of hubspotutk is " + {{HubSpot-UTK}});
</script>

Hi Isaac,

unfortunately, we are reaching the limits of my technical abilities. I will ask an engineer from my team to join the conversation.

By Google Script I mean Google Apps Script. We use it to hack some of our platforms together and to call APIs. There is actually a TagManager Service where we can call tag manager programatically from an Apps Script. So maybe your workaround would work for us.

But let me bring our engineer here :-).

Hi, @basil.

Apologies, I got a bit ahead of myself in that last post. I misunderstood the capabilities of Google Apps Script and have since deleted the post.

I’ll wait for additional context from your engineer!