icy-queen-60245
10/01/2024, 5:46 PMjolly-florist-66728
10/01/2024, 5:46 PMflytectl
config file to use PKCE (Proof Key for Code Exchange) for authentication, you need to update the config.yaml
file. Here are the steps:
1. Update config.yaml
: Modify the config.yaml
file to include the necessary PKCE configuration.
admin:
# Update with the Flyte's ingress endpoint (e.g. flyteIngressIP for sandbox or example.foobar.com)
# You must keep the 3 forward-slashes after dns:
endpoint: dns:///<Flyte ingress url>
# Update auth type to `Pkce`
authType: Pkce
# Set to the clientId (will be used for both Pkce and ClientSecret flows)
# Leave empty to use the value discovered through flyteAdmin's Auth discovery endpoint.
clientId: <Id>
# Set to the location where the client secret is mounted.
# Only needed/used for `ClientSecret` flow.
clientSecretLocation: </some/path/to/key>
2. Environment Variables: Ensure the necessary environment variables are set for PKCE.
export FLYTE_CREDENTIALS_CLIENT_ID=<client_id>
export FLYTE_CREDENTIALS_CLIENT_SECRET=<client_secret>
export FLYTE_CREDENTIALS_AUTH_MODE=basic
export FLYTE_CREDENTIALS_AUTHORIZATION_METADATA_KEY=<header name>
export FLYTE_CREDENTIALS_OAUTH_SCOPES=<idp defined scopes>
export FLYTE_PLATFORM_AUTH=True
3. Helm Chart Configuration: Ensure your Helm chart values file is correctly configured for PKCE.
auth:
appAuth:
authServerType: External
externalAuthServer:
baseUrl: <https://login.microsoftonline.com>/<tenant-id>/oauth2/v2.0/authorize
metadataUrl: .well-known/oauth-authorization-server
thirdPartyConfig:
flyteClient:
clientId: <flytectl-client-id>
redirectUri: http://localhost:53593/callback
scopes:
- offline
- all
userAuth:
openId:
baseUrl: <https://login.microsoftonline.com>/<tenant-id>/oauth2/v2.0/authorize
scopes:
- profile
- openid
clientId: <oidc-clientId>
For more detailed information, refer to the Flytectl configuration documentation.
Would you like more detail on any specific part of the setup?
Sources:
- Flytectl Configuration
- Flytectl Configuration 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.icy-queen-60245
10/01/2024, 5:55 PMjolly-florist-66728
10/01/2024, 5:55 PMflytectl
works with PKCE, you need to make a few adjustments to your Helm configuration. Specifically, you need to ensure that the authServerType
is set to External
and that the thirdPartyConfig
is correctly configured for PKCE. Here is the updated configuration:
auth:
enabled: true
enableAuthServer: false # Disable internal auth server
oidc:
baseUrl: "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_acjb0eMJZ"
clientId: "myid-redacted"
clientSecret: "mysecret-redacted"
internal:
clientId: flytepropeller
clientSecret: "mysecret-redacted"
clientSecretHash: ""
appAuth:
authServerType: External # Use external auth server
externalAuthServer:
baseUrl: "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_acjb0eMJZ"
metadataUrl: .well-known/openid-configuration
thirdPartyConfig:
flyteClient:
clientId: flytectl
redirectUri: "https://my.domain.com/callback"
scopes:
- all
userAuth:
openId:
baseUrl: "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_acjb0eMJZ"
scopes:
- profile
- openid
clientId: "myid-redacted"
authorizedUris:
- "https://my.domain.com"
clientSecretsExternalSecretRef: ""
Key changes:
1. Disable Internal Auth Server: Set enableAuthServer
to false
.
2. Set External Auth Server: Add appAuth
section with authServerType
set to External
.
3. Configure thirdPartyConfig
: Ensure flyteClient
is configured with the correct clientId
, redirectUri
, and scopes
.
Would you like more detail on any specific part of the setup?
Sources:
- https://docs.flyte.org/en/latest/deployment/cluster_config/auth_setup.html#panel-3-Zmx5dGUtY29yZQ%3D%3D
- https://docs.flyte.org/en/latest/deployment/cluster_config/auth_setup.html#panel-2-QXp1cmUgQUQ%3D 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.icy-queen-60245
10/01/2024, 6:05 PMjolly-florist-66728
10/01/2024, 6:05 PMflytectl
to use PKCE with the updated Helm configuration, you need to update your config.yaml
file accordingly. Here is what your flytectl
config.yaml
should look like:
admin:
# Update with the Flyte's ingress endpoint (e.g. flyteIngressIP for sandbox or example.foobar.com)
# You must keep the 3 forward-slashes after dns:
endpoint: dns:///<Flyte ingress url>
# Update auth type to `Pkce`
authType: Pkce
# Set to the clientId (will be used for both Pkce and ClientSecret flows)
# Leave empty to use the value discovered through flyteAdmin's Auth discovery endpoint.
clientId: flytectl
# Set to the location where the client secret is mounted.
# Only needed/used for `ClientSecret` flow.
clientSecretLocation: </some/path/to/key>
Additionally, ensure the necessary environment variables are set for PKCE:
export FLYTE_CREDENTIALS_CLIENT_ID=flytectl
export FLYTE_CREDENTIALS_CLIENT_SECRET=<client_secret>
export FLYTE_CREDENTIALS_AUTH_MODE=basic
export FLYTE_CREDENTIALS_AUTHORIZATION_METADATA_KEY=<header name>
export FLYTE_CREDENTIALS_OAUTH_SCOPES=<idp defined scopes>
export FLYTE_PLATFORM_AUTH=True
This configuration ensures that flytectl
uses PKCE for authentication, aligning with the changes made in your Helm configuration.
Would you like more detail on any specific part of the setup?
Sources:
- Flytectl Configuration
- Flytectl Configuration 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.average-finland-92144
10/01/2024, 6:38 PMicy-queen-60245
10/01/2024, 6:53 PMaverage-finland-92144
10/01/2024, 8:11 PMflytectl
or pyflyte
it throws the error you shared right?icy-queen-60245
10/01/2024, 8:13 PM{
"error": "invalid_request",
"error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. The 'redirect_uri' parameter does not match any of the OAuth 2.0 Client's pre-registered redirect urls."
}
average-finland-92144
10/01/2024, 8:15 PMconfiguration:
auth:
enabled: true
oidc:
baseUrl: https://<your-IdP-base-url> # Uncomment
clientId: <client_ID>
clientSecret: <client_secret>
internal:
clientSecret: '<your-random-password>'
clientSecretHash: <your-hashed-password>
authorizedUris:
- https://<your-flyte-deployment-URL>
average-finland-92144
10/01/2024, 8:16 PMhttps://<your-deployment-URL>/callback
as redirect URIaverage-finland-92144
10/01/2024, 8:16 PMicy-queen-60245
10/01/2024, 8:17 PMicy-queen-60245
10/01/2024, 8:18 PMaverage-finland-92144
10/01/2024, 8:21 PMinternal:
clientId: flytepropeller
clientSecret: "redacted"
clientSecretHash: ""
flyteClient:
clientId: flytectl
redirectUri: "https://my.domain.com/callback" #http://localhost:53593/callback
scopes:
- all
audience: ""
authorizedUris:
- "https://my.domain.com"
clientSecretsExternalSecretRef: ""I think this section has extra content that's midway between the internal auth server (what you need) and using your IdPs custom auth server (not the scope here). Using your IdP for OIDC only, requires that propeller registers to flyteadmin's auth server as a client, that's what
internal
means here. So it would only need
internal:
clientSecret: '<your-random-password>'
clientSecretHash: <your-hashed-password>
icy-queen-60245
10/01/2024, 8:25 PMaverage-finland-92144
10/01/2024, 8:25 PMclient secret
that your IdP gives you, it's just a random password you generateicy-queen-60245
10/01/2024, 8:31 PMaverage-finland-92144
10/01/2024, 8:42 PM