Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SP to Tableau #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tableau-databricks/connection-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ limitations under the License.
params["AUTH_ACCESSTOKEN"] = attr["ACCESSTOKEN"];
break;

case "auth-client-creds":
params["AUTHMECH"] = 11;
params["AUTH_FLOW"] = 1;
params["Auth_Client_ID"] = attr[connectionHelper.attributeUsername];
params["Auth_Client_Secret"] = attr[connectionHelper.attributePassword];
params["Auth_Scope"] = "all-apis";
break;

default:
return connectionHelper.ThrowTableauException("Unsupported authentication mode: " + authenticationMode);
}
Expand Down
30 changes: 23 additions & 7 deletions tableau-databricks/connection-fields.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,43 @@ limitations under the License. -->
<validation-rule reg-exp="^([0-9A-Za-z-]+\.)+([0-9A-Za-z-]+)$" />
</field>
<!-- /Endpoint -->


<field name="instanceurl" label="@string/authentication_oauth_endpoint_prompt/" category="authentication" value-type="string">
<conditions>
<condition field="authentication" value="oauth" />
</conditions>
<!-- limit to well-known domains:
https://*.microsoftonline.(com|us|de|cn) (public, govcloud, germany, china),
https://*.chinacloudapi.cn (China)
https://*/oidc (Databricks redirector) -->
<validation-rule reg-exp="^https:\/\/([a-zA-Z0-9-]+\.)+((microsoftonline\.(com|us|cn|de))|chinacloudapi\.cn|[a-zA-Z]+\/oidc)" />
</field>

<field name="v-http-path" label="@string/http_path_prompt/" category="endpoint" value-type="string" />

<!-- Authentication -->
<field name="authentication" label="@string/authentication_prompt/" category="authentication" value-type="selection" default-value="oauth">
<selection-group>
<option label="@string/authentication_label_oauth/" value="oauth"/>
<option label="@string/authentication_label_token/" value="auth-pass"/>
<option label="@string/authentication_label_sp/" value="auth-client-creds" />
</selection-group>
</field>

<field name="username" label="@string/sp_client_id_prompt/" category="authentication" value-type="string">
<conditions>
<condition field="authentication" value="auth-client-creds" />
</conditions>
</field>

<field name="password" label="@string/password_prompt/" category="authentication" value-type="string" secure="true">
<conditions>
<conditions>
<condition field="authentication" value="auth-pass" />
<condition field="authentication" value="auth-client-creds" />
</conditions>
</field>


<!-- /Authentication -->

<!-- Proxy -->
Expand Down Expand Up @@ -74,9 +94,5 @@ limitations under the License. -->
</field>-->
<!-- /Proxy -->

<field name="odbc-connect-string-extras" label="@string/odbc_extra_config_prompt/" category="advanced" value-type="string" optional="true">
<!-- valid keys: test, Test, SSP_spark.test -->
<!-- valid values: word, Word, some-arbitrary*string, {has-semicolon;}, {has{closing}}bracket;} -->
<validation-rule reg-exp="^(([a-zA-Z0-9_.-]+)=(([^{};]*)|(\{((\}\}|[^}])*)\}));)*(([a-zA-Z0-9_.-]+)=(([^{};]*)|(\{((\}\}|[^}])*)\})))?$" />
</field>

</connection-fields>
2 changes: 1 addition & 1 deletion tableau-databricks/connection-resolver.tdr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

<tdr class='databricks'>
<tdr class='databricks2'>
<connection-resolver>
<connection-builder>
<script file='connection-builder.js'/>
Expand Down
2 changes: 1 addition & 1 deletion tableau-databricks/dialect.tdd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
-->

<dialect name='DatabricksDialect'
class='databricks'
class='databricks2'
base='Hive12Dialect'
version='18.1'>

Expand Down
9 changes: 5 additions & 4 deletions tableau-databricks/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

<connector-plugin class='databricks' superclass='spark' plugin-version='1.0' name='@string/databricks/' version='18.1'>
<connection-customization class="databricks" enabled="true" version="1.0">
<vendor name="databricks"/>
<driver name="databricks"/>
<connector-plugin class='databricks2' superclass='spark' plugin-version='1.0' name='@string/databricks/' version='18.1'>
<vendor-information> <company name="Company Name"/> <support-link url = "https://example.com"/> </vendor-information>
<connection-customization class="databricks2" enabled="true" version="1.0">
<vendor name="databricks2"/>
<driver name="databricks2"/>
<customizations>
<!-- ### Properties inherited from the Spark SQL connector -->
<customization name='CAP_AUTH_DB_IMPERSONATE' value='no' />
Expand Down
7 changes: 1 addition & 6 deletions tableau-databricks/oauth-config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<pluginOAuthConfig>
<dbclass>databricks</dbclass>
<dbclass>databricks2</dbclass>

<clientIdDesktop>0464ea90-c12f-42a7-b347-c2311ca4413c</clientIdDesktop>
<redirectUrisDesktop>http://localhost:55555/Callback</redirectUrisDesktop>
Expand All @@ -11,7 +11,6 @@

<authUri>/oauth2/v2.0/authorize</authUri>
<tokenUri>/oauth2/v2.0/token</tokenUri>
<instanceUrlSuffix>/oidc</instanceUrlSuffix>
<instanceUrlValidationRegex>^https:\/\/([a-zA-Z0-9-]+\.)+((microsoftonline\.(com|us|cn|de))|chinacloudapi\.cn|[a-zA-Z]+\/oidc).*</instanceUrlValidationRegex>

<scopes>openid</scopes>
Expand Down Expand Up @@ -57,10 +56,6 @@
<key>OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_INFER_INSTANCE_URL_FROM_SERVER</key>
<value>true</value>
</entry>
</capabilities>
<accessTokenResponseMaps>
<entry>
Expand Down
4 changes: 4 additions & 0 deletions tableau-databricks/resources-en_US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ limitations under the License. -->
<string name="authentication_prompt">Authentication</string>
<string name="authentication_label_oauth">Databricks login (recommended)</string>
<string name="authentication_label_token">Personal access token</string>
<string name="authentication_label_sp">Service Principal OAuth</string>
<string name="authentication_label_user_pass">Basic auth (legacy)</string>
<string name="authentication_oauth_advanced_options_prompt">Advanced configuration for OAuth</string>
<string name="authentication_oauth_endpoint_prompt">OAuth Endpoint e.g. https://[Server Hostname]/oidc</string>

<string name="username_prompt">Username</string>
<string name="password_prompt">Token</string>

<string name="sp_client_id_prompt">Client ID</string>
<string name="sp_client_secret_prompt">Client Secret</string>

<string name="odbc_extra_config_prompt">Extra ODBC options ('key=value;key2=value2;...')</string>

<string name="metadata_catalog_prompt">Catalog</string>
Expand Down