Skip to content

Commit

Permalink
[PAPPY-356] : Tableau Desktop https://github.com/datadotworld/tableau…
Browse files Browse the repository at this point in the history
…-connector (#111)

* oauth url update

* yarn fix

* node engine update

* circle ci change

* update node engine

* update node engine

* package change

* package update

* package update

* circle update

* circle update

* package update
  • Loading branch information
nikhilhegde-ddw authored Sep 30, 2022
1 parent c334ef7 commit 5841091
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ jobs:
build:
working_directory: ~/tableau-connector
docker:
- image: circleci/node:8.9.4
- image: circleci/node:14.18.2
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: yarn install --frozen-lockfile
command: yarn install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ issues and propose changes to the current or next version of the data.world Web

The connector uses `data.world`'s [OAuth 2.0 flow for native applications](https://apidocs.data.world/v0/data-world-for-developers/oauth#native-applications-desktop-mobile-static-sites-other)

After determining it is running in a Tableau environment the app redirects to `https://data.world/oauth/authorize` supplying the following as query params:
After determining it is running in a Tableau environment the app redirects to `https://auth.data.world/oauth/authorize` supplying the following as query params:
* client_id
* redirect_uri
* response_type
* code_challenge_method
* code_challenge

The user is asked to log in to `data.word` and authorize the application. If successful the app redirects to the provided `redirect_uri` with a `code` query param.
The user is asked to select and log in to `data.word` instance and authorize the application. If successful the app redirects to the provided `redirect_uri` with a `code` query param.

The app then makes a `POST` request to `https://data.world/oauth/access_token` providing the following in the body of the request:
* The `code` returned
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ To enable scheduled refreshes for extracts created from data.world WDC, we'll ne

2. tabadmin whitelist_webdataconnector -a https://tableau.data.world:443

3. tabadmin whitelist_webdataconnector -s https://tableau.data.world:443 https://api.data.world/(.*),https://query.data.world/(.*),https://data.world/oauth/(.*)
3. tabadmin whitelist_webdataconnector -s https://tableau.data.world:443 https://api.data.world/(.*),https://query.data.world/(.*),https://data.world/oauth/(.*),https://auth.data.world/oauth/(.*)

4. tabadmin restart

For more info see [tabadmin Commands](https://onlinehelp.tableau.com/v10.5/server/en-us/tabadmin_cmd.htm#whitelist_wdc)

B. To configure safe list for Tableau Server version 2018.1 and above run the following commands on the machine

1. tsm data-access web-data-connectors add --name 'DW WDC' --url https://tableau.data.world:443 --secondary https://api.data.world/*, https://query.data.world/*, https://data.world/oauth/*
1. tsm data-access web-data-connectors add --name 'DW WDC' --url https://tableau.data.world:443 --secondary https://api.data.world/*, https://query.data.world/*, https://data.world/oauth/*, https://auth.data.world/oauth/*

2. tsm data-access web-data-connectors allow

Expand All @@ -67,4 +67,4 @@ If you'd like to contribute, please follow the [Contributing Guidelines](CONTRIB

## License

Apache License 2.0
Apache License 2.0
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"engines": {
"node": "8.9.4"
"node": "14.18.2"
},
"dependencies": {
"@sentry/browser": "4.1.1",
Expand All @@ -15,6 +15,7 @@
"react": "15.6.2",
"react-bootstrap": "0.30.7",
"react-dom": "15.6.2",
"react-scripts": "0.9.5",
"serve": "10.0.0",
"uuid": "3.3.2"
},
Expand All @@ -29,7 +30,6 @@
"eslint-plugin-promise": "3.7.0",
"eslint-plugin-react": "7.8.2",
"eslint-plugin-standard": "3.1.0",
"react-scripts": "0.9.5",
"react-test-renderer": "15.4.2"
},
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { parseJSON } from './util.js'

const apiTokenKey = 'DW-API-KEY'
const codeVerifierKey = 'DW-CODE-VERIFIER'
const oAuthBaseSite = process.env.REACT_APP_AUTH_SITE || 'https://auth.data.world'

const generateCodeVerifier = () => {
const lowerCase = 'abcdefghijklmnopqrstuvwxyz'
Expand Down Expand Up @@ -119,7 +120,7 @@ const getAuthUrl = (codeVerifier, state) => {
const agentid = dataset_name.split('/')[0]
const agentidParam = agentid ? `&agentid=${agentid}` : ''

return `${process.env.REACT_APP_BASE_SITE}/oauth/authorize?client_id=${process.env.REACT_APP_OAUTH_CLIENT_ID}` +
return `${oAuthBaseSite}/oauth/authorize?client_id=${process.env.REACT_APP_OAUTH_CLIENT_ID}` +
`&redirect_uri=${process.env.REACT_APP_OAUTH_REDIRECT_URI}` +
`&response_type=code&code_challenge_method=S256&code_challenge=${codeChallenge}` +
`${agentidParam}` +
Expand Down

0 comments on commit 5841091

Please sign in to comment.