From 6a9f145f03bf56870355b13c5d9e379099254a89 Mon Sep 17 00:00:00 2001 From: Jade Koskela Date: Tue, 26 Mar 2024 11:34:25 -0700 Subject: [PATCH 1/5] Update OAuth examples --- samples/components/oauth/athena.okta.xml | 8 +- .../oauth/redshift.azure.iam-idc.xml | 73 +++++++++++++++++++ samples/components/oauth/redshift.azure.xml | 24 +++--- 3 files changed, 93 insertions(+), 12 deletions(-) create mode 100644 samples/components/oauth/redshift.azure.iam-idc.xml diff --git a/samples/components/oauth/athena.okta.xml b/samples/components/oauth/athena.okta.xml index 4aa7244a..e562d614 100644 --- a/samples/components/oauth/athena.okta.xml +++ b/samples/components/oauth/athena.okta.xml @@ -1,7 +1,11 @@ athena + + custom_athena_okta + + Okta $clientID $clientSecret http://localhost:55556/Callback @@ -33,7 +37,7 @@ OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM - true + false OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN @@ -63,7 +67,7 @@ username - preferred_username + email \ No newline at end of file diff --git a/samples/components/oauth/redshift.azure.iam-idc.xml b/samples/components/oauth/redshift.azure.iam-idc.xml new file mode 100644 index 00000000..3cf36199 --- /dev/null +++ b/samples/components/oauth/redshift.azure.iam-idc.xml @@ -0,0 +1,73 @@ + + + redshift + + custom_redshift_azure_iam_idc + ${clientID} + ${clientSecret} + http://localhost:55556/Callback + http://localhost:55557/Callback + http://localhost:55558/Callback + http://localhost:55559/Callback + + https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize + https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token + openid + offline_access + email + + api://${customAPI}/Redshift + + + OAUTH_CAP_REQUIRES_PROMPT_SELECT_ACCOUNT + true + + + OAUTH_CAP_REQUIRE_PKCE + true + + + OAUTH_CAP_PKCE_REQUIRES_CODE_CHALLENGE_METHOD + true + + + OAUTH_CAP_SUPPORTS_STATE + true + + + OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM + true + + + OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN + true + + + + OAUTH_CAP_FIXED_PORT_IN_CALLBACK_URL + true + + + + + ACCESSTOKEN + access_token + + + REFRESHTOKEN + refresh_token + + + id-token + id_token + + + username + email + + + access-token-expires-in + expires_in + + + \ No newline at end of file diff --git a/samples/components/oauth/redshift.azure.xml b/samples/components/oauth/redshift.azure.xml index b66aed9c..b3a41bd4 100644 --- a/samples/components/oauth/redshift.azure.xml +++ b/samples/components/oauth/redshift.azure.xml @@ -1,20 +1,23 @@ redshift + + custom_redshift_azure + + Azure $clientID $clientSecret http://localhost:55556/Callback http://localhost:55557/Callback http://localhost:55558/Callback http://localhost:55559/Callback - https://${msUrlBegin}/oauth2/v2.0/authorize - https://${msUrlBegin}/oauth2/v2.0/token + + https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize + https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token openid email - profile offline_access - OAUTH_CAP_REQUIRES_PROMPT_SELECT_ACCOUNT @@ -34,12 +37,17 @@ OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM - true + false OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN true + + + OAUTH_CAP_FIXED_PORT_IN_CALLBACK_URL + false + @@ -50,10 +58,6 @@ REFRESHTOKEN refresh_token - - access-token-issue-time - issued_at - access-token-expires-in expires_in @@ -64,7 +68,7 @@ username - preferred_username + email From 00b79e82535ce25eb5f2c5726f1041851c5dee40 Mon Sep 17 00:00:00 2001 From: Jade Koskela Date: Tue, 26 Mar 2024 13:19:12 -0700 Subject: [PATCH 2/5] Switch back to preferred_username for first azure example --- samples/components/oauth/redshift.azure.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/components/oauth/redshift.azure.xml b/samples/components/oauth/redshift.azure.xml index b3a41bd4..c8668b9e 100644 --- a/samples/components/oauth/redshift.azure.xml +++ b/samples/components/oauth/redshift.azure.xml @@ -66,9 +66,11 @@ id-token id_token + + username - email + preferred_username From 9bd9a46bfed48270201aae5aed0e361264303a32 Mon Sep 17 00:00:00 2001 From: Jade Koskela Date: Tue, 26 Mar 2024 13:41:46 -0700 Subject: [PATCH 3/5] Add issued-at back --- samples/components/oauth/redshift.azure.iam-idc.xml | 4 ++++ samples/components/oauth/redshift.azure.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/samples/components/oauth/redshift.azure.iam-idc.xml b/samples/components/oauth/redshift.azure.iam-idc.xml index 3cf36199..a6293a0e 100644 --- a/samples/components/oauth/redshift.azure.iam-idc.xml +++ b/samples/components/oauth/redshift.azure.iam-idc.xml @@ -57,6 +57,10 @@ REFRESHTOKEN refresh_token + + access-token-issue-time + issued_at + id-token id_token diff --git a/samples/components/oauth/redshift.azure.xml b/samples/components/oauth/redshift.azure.xml index c8668b9e..10099c3c 100644 --- a/samples/components/oauth/redshift.azure.xml +++ b/samples/components/oauth/redshift.azure.xml @@ -58,6 +58,10 @@ REFRESHTOKEN refresh_token + + access-token-issue-time + issued_at + access-token-expires-in expires_in From c77424bd30156bedbb51c12fee6cf85d10d49417 Mon Sep 17 00:00:00 2001 From: Jade Koskela Date: Tue, 26 Mar 2024 13:46:12 -0700 Subject: [PATCH 4/5] Address comments --- samples/components/oauth/athena.okta.xml | 2 +- samples/components/oauth/redshift.azure.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/components/oauth/athena.okta.xml b/samples/components/oauth/athena.okta.xml index e562d614..16ef7edc 100644 --- a/samples/components/oauth/athena.okta.xml +++ b/samples/components/oauth/athena.okta.xml @@ -67,7 +67,7 @@ username - email + preferred_username \ No newline at end of file diff --git a/samples/components/oauth/redshift.azure.xml b/samples/components/oauth/redshift.azure.xml index 10099c3c..9b7887d1 100644 --- a/samples/components/oauth/redshift.azure.xml +++ b/samples/components/oauth/redshift.azure.xml @@ -17,6 +17,8 @@ https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token openid email + + profile offline_access From 1590ba1f591e6e08063256f60bed75ffb2d1d8cd Mon Sep 17 00:00:00 2001 From: Jade Koskela Date: Tue, 26 Mar 2024 13:58:21 -0700 Subject: [PATCH 5/5] Minor changes --- samples/components/oauth/redshift.azure.iam-idc.xml | 2 +- samples/components/oauth/redshift.azure.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/components/oauth/redshift.azure.iam-idc.xml b/samples/components/oauth/redshift.azure.iam-idc.xml index a6293a0e..9631021e 100644 --- a/samples/components/oauth/redshift.azure.iam-idc.xml +++ b/samples/components/oauth/redshift.azure.iam-idc.xml @@ -36,7 +36,7 @@ OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM - true + false OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN diff --git a/samples/components/oauth/redshift.azure.xml b/samples/components/oauth/redshift.azure.xml index 9b7887d1..478f1278 100644 --- a/samples/components/oauth/redshift.azure.xml +++ b/samples/components/oauth/redshift.azure.xml @@ -39,7 +39,7 @@ OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM - false + true OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN