stoddabr / react-tableau-embed-live

Wrapps Tableau Embedded API in a React Component
MIT License
22 stars 6 forks source link

Support Connected App Tokens #17

Closed przcntn closed 1 year ago

przcntn commented 1 year ago

Are you intending to support the token aspect of the Viz?

https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/viz.html#token

stoddabr commented 1 year ago

Personally, I'm not a fan of the token based authentication for two reasons: the only private tableau server I have to test with is behind a firewall which prevents the proper headers from being passed so I cannot test this e2e, and it's legally tricky to implement as giving users access who do not have licenses violates Tableau's T&C. Ensuring that only licensed users have access to the token is outside of the scope of this library as it would require some external auth system. Imo tokens are tricky which is why I have not included them here.

That said, it wouldn't be difficult to prop drill a token into the viz component. If I open a PR would you be willing/able to test it?

przcntn commented 1 year ago

Cheers for the reply, you could test it via a connected app on a dev server which Tableau would give you for free as they like people messing around with the embedding stuff. (Just sign up to be a tableau dev and you get one provisioned and then can publish anything, change the perms and make a connected app which diff users and it should 404 when the wrong user trys to view)

The new embedded analytics model makes using connected apps a lot more practical as once generate the jwt via the username its a very nice and clean solution to managing authentication as mentioned above via a frontend website but I am more than happy to help test stuff as your implementation does everything I had figured was going to have to rework myself with regards to all the listeners so great stuff writing it all.

Appreciate the T&C concerns though. Personally I think they made the connected apps to see the real world usage of token / account sharing to factor in to the new licence model.

stoddabr commented 1 year ago

Cheers indeed!

I'll start working on a branch now. Although, I won't have time to setup and test with a Tableau dev environment for a few days. I'll let you know when I open a PR so you can test it with your setup.

I'd be interested to hear more about flow with the embedded analytics model -- I have not used or heard about it before in this context.

stoddabr commented 1 year ago

@przcntn https://github.com/stoddabr/react-tableau-embed-live/pull/18

stoddabr commented 1 year ago

Let me know if that PR works for you!

przcntn commented 1 year ago

Sweet cheers! Didn't expect a reply this eve ha so will test it in the morn and let you know and follow up with some more detail on my current setup that makes use of it when it does.

przcntn commented 1 year ago

As simple as just adding that token in!

Cheers all works as expected.

Flow wise Tableau released an update (https://www.tableau.com/products/embedded-analytics) recently that was more geared towards empowering companies to use the Tableau dashboards in a portal that was being sold to other client solutions. This is what my company is moving towards as with embedded you pay by usage not by viewer which means you have an unlimited number of viewer accounts on the server (which is obvs where the previous account sharing would happen) and then pay based on page views / data extracts etc etc.

We then use our own auth system to login, pass the username to the jwt to build the token and use that to load everything via a Connected App as its much cleaner solution and still maintain the row level security. https://tableau-connectedapps.theinformationlab.io/ Something like that

stoddabr commented 1 year ago

Thanks for testing. The feature is now live in v3.22