Skip to content

Commit

Permalink
Merge pull request #1167 from tableau/jkoskela-add-oauth-examples
Browse files Browse the repository at this point in the history
Fix callback URLs, Add README
  • Loading branch information
jkoskela committed Aug 11, 2023
2 parents 2404021 + b453206 commit 5ff6edc
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 66 deletions.
8 changes: 8 additions & 0 deletions samples/components/oauth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# OAuth Config Templates

For these templates, if you are using the corresponding IDP, you should only have to substitute the following:
- Desktop client ID
- Desktop client Secret
- IDP URL prefix/domain name

See the [OAuth](https://tableau.github.io/connector-plugin-sdk/docs/oauth) section in the SDK docs for more information.
8 changes: 5 additions & 3 deletions samples/components/oauth/athena.okta.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<pluginOAuthConfig>
<dbclass>athena</dbclass>
<oauthConfigId>custom_athena_okta</oauthConfigId>
<clientIdDesktop>$clientID</clientIdDesktop>
<clientSecretDesktop>$clientSecret</clientSecretDesktop>
<redirectUrisDesktop>http://localhost:56666/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:56667/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:56668/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55556/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55557/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55558/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55559/Callback</redirectUrisDesktop>
<authUri>https://${oktaDomain}/oauth2/v1/authorize</authUri>
<tokenUri>https://${oktaDomain}/oauth2/v1/token</tokenUri>
<scopes>openid</scopes>
Expand Down
130 changes: 67 additions & 63 deletions samples/components/oauth/redshift.azure.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<pluginOAuthConfig>
<dbclass>redshift</dbclass>
<oauthConfigId>custom_redshift_azure</oauthConfigId>
<clientIdDesktop>$clientID</clientIdDesktop>
<clientSecretDesktop>$clientSecret</clientSecretDesktop>
<authUri>https://${msUrlBegin}/oauth2/v2.0/authorize</authUri>
<tokenUri>https://${msUrlBegin}/oauth2/v2.0/token</tokenUri>
<scopes>openid</scopes>
<scopes>email</scopes>
<scopes>profile</scopes>
<scopes>offline_access</scopes>
<scopes></scopes>
<capabilities>
<entry>
<key>OAUTH_CAP_REQUIRES_PROMPT_SELECT_ACCOUNT</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_REQUIRE_PKCE</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_PKCE_REQUIRES_CODE_CHALLENGE_METHOD</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN</key>
<value>true</value>
</entry>
</capabilities>
<accessTokenResponseMaps>
<entry>
<key>ACCESSTOKEN</key>
<value>access_token</value>
</entry>
<entry>
<key>REFRESHTOKEN</key>
<value>refresh_token</value>
</entry>
<entry>
<key>access-token-issue-time</key>
<value>issued_at</value>
</entry>
<entry>
<key>access-token-expires-in</key>
<value>expires_in</value>
</entry>
<entry>
<key>id-token</key>
<value>id_token</value>
</entry>
<entry>
<key>username</key>
<value>preferred_username</value>
</entry>
</accessTokenResponseMaps>
</pluginOAuthConfig>

<?xml version="1.0" encoding="utf-8"?>
<pluginOAuthConfig>
<dbclass>redshift</dbclass>
<oauthConfigId>custom_redshift_azure</oauthConfigId>
<clientIdDesktop>$clientID</clientIdDesktop>
<clientSecretDesktop>$clientSecret</clientSecretDesktop>
<redirectUrisDesktop>http://localhost:55556/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55557/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55558/Callback</redirectUrisDesktop>
<redirectUrisDesktop>http://localhost:55559/Callback</redirectUrisDesktop>
<authUri>https://${msUrlBegin}/oauth2/v2.0/authorize</authUri>
<tokenUri>https://${msUrlBegin}/oauth2/v2.0/token</tokenUri>
<scopes>openid</scopes>
<scopes>email</scopes>
<scopes>profile</scopes>
<scopes>offline_access</scopes>
<scopes></scopes>
<capabilities>
<entry>
<key>OAUTH_CAP_REQUIRES_PROMPT_SELECT_ACCOUNT</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_REQUIRE_PKCE</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_PKCE_REQUIRES_CODE_CHALLENGE_METHOD</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM</key>
<value>true</value>
</entry>
<entry>
<key>OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN</key>
<value>true</value>
</entry>
</capabilities>
<accessTokenResponseMaps>
<entry>
<key>ACCESSTOKEN</key>
<value>access_token</value>
</entry>
<entry>
<key>REFRESHTOKEN</key>
<value>refresh_token</value>
</entry>
<entry>
<key>access-token-issue-time</key>
<value>issued_at</value>
</entry>
<entry>
<key>access-token-expires-in</key>
<value>expires_in</value>
</entry>
<entry>
<key>id-token</key>
<value>id_token</value>
</entry>
<entry>
<key>username</key>
<value>preferred_username</value>
</entry>
</accessTokenResponseMaps>
</pluginOAuthConfig>

0 comments on commit 5ff6edc

Please sign in to comment.