Authenticating in Flyte#
The Flyte platform consists of multiple components. Securing communication between each component is crucial to ensure the integrity of the overall system.
The following diagram summarizes the components and their interactions as part of Flyte’s auth implementation:

In summary, there are two main resources required for a complete auth flow in Flyte:
Identity Layer
The OpenID Connect (OIDC) protocol allows clients (such as Flyte) to confirm the identity of a user, based on authentication done by an Authorization Server. To enable this, you first need to register Flyte as an app (client) with your chosen Identity Provider (IdP).
An authorization server
As defined by IETF’s RFC #6749 , the authorization server’s job is to issue access tokens to clients after verifying the user (resource owner) and getting their consent. In this setup:
The user of Flyte, is the resource owner.
The client is the tool or component that intends to interact with
flyteadmin
:flytepropeller
,flyteconsole
or any of the CLI tools likeflytectl
.
There are two supported options to use an authorization server in Flyte:
Internal authorization server: It comes pre-installed with Flyte and it is a suitable choice for quick start and testing purposes.
External (custom) authorization server: This a service provided by one of the supported IdPs and is the recommended option if your organization needs to retain control over scope definitions and grants, token expiration policies and other advanced security controls.
Note
Regardless of the type of authorization server to use, you will still need an IdP to provide identity through OIDC.
Authentication Setup#
Prerequisites#
The following is required for non-sandbox (non flytectl demo
) deployments:
A public domain name (e.g. example.foobar.com)
Routing of traffic from that domain name to the Kubernetes Flyte Ingress IP address
Note
Checkout this community-maintained guide for more information about setting up Flyte in production, including Ingress.
Identity Providers Support#
Flyte supports OAuth2 and OpenId Connect to secure the various connections:
OpenID Connect: used to secure user’s authentication to
flyteadmin
through the UI.OAuth2: used to secure connections from clients (i.e.
pyflyte
,flytectl
andflytepropeller
) to theflyteadmin
service.
Support for these protocols varies per IdP. Checkout the following table to understand the available support level for your IdP:
Feature |
Okta |
Google free |
GCP Identity Service |
Azure AD |
Auth0 |
KeyCloak |
Github |
---|---|---|---|---|---|---|---|
OpenID Connect (OIDC) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
No |
Custom Auth Server |
Yes |
No |
Yes |
Yes |
? |
Yes |
No |
Identity Management layer : OIDC#
In this section, you can find canonical examples of how to set up OIDC on some of the supported IdPs; enabling users to authenticate in the browser.
Create an OAuth2 Client Credential following the official documentation and take note of the
client_id
andclient_secret
In the Authorized redirect URIs field, add
http://localhost:30081/callback
for sandbox deployments, orhttps://<your-deployment-URL>/callback
for other methods of deployment.
If you don’t already have an Okta account, sign up for one here.
Create an app integration, with OIDC - OpenID Connect as the sign-on method and Web Application as the app type.
Add sign-in redirect URIs:
http://localhost:30081/callback
for sandbox orhttps://<your deployment url>/callback
for other Flyte deployment types.
Optional - Add logout redirect URIs:
http://localhost:30081/logout
for sandbox,https://<your deployment url>/callback
for other Flyte deployment types).
Take note of the Client ID and Client Secret
If you don’t have a Keycloak installation, you can use this which provides a quick way to deploy Keycloak cluster on AWS.
Create a realm using the admin console
Create an OIDC client with client secret and note them down. Use the following instructions
Add Login redirect URIs:
http://localhost:30081/callback
for sandbox orhttps://<your deployment url>/callback
for other Flyte deployment types.
Microsoft Entra ID (Azure AD) Setup
In the Azure portal, open Microsoft Entra ID from the left-hand menu.
- From the Overview section, navigate to App registrations > + New registration.
Under Supported account types, select the option based on your organization’s needs.
- Configure Redirect URIs
- In the Redirect URI section:
Choose Web from the platform dropdown.
- Enter the following URIs based on your environment:
Sandbox: http://localhost:30081/callback
Production: https://<your-deployment-URL>/callback
- Obtain Tenant and Client Information
After registration, go to the app’s Overview page.
Take note of the Application (client) ID and Directory (tenant) ID—you’ll need these in your Flyte configuration.
- Create a Client Secret
From the Certificates & Secrets tab, click + New client secret.
Add a Description and set an Expiration period (e.g., 6 months or 12 months).
Click Add and copy the Value of the client secret— it will be used in the helm values.
- If the Flyte deployment will be dealing with user data, set API permissions:
Navigate to API Permissions > + Add a permission.
- Select Microsoft Graph > Delegated permissions, and add the following permissions:
email
openid
profile
offline_access
User.Read
- Expose an API (for Custom Scopes)
- In the Expose an API tab:
Click + Add a scope, and set the Scope name (e.g., access_flyte).
Provide a Consent description and enable Admin consent required and Save.
Then, click + Add a client application and enter the Client ID of your Flyte application.
- Configure Mobile/Desktop Flow (for flytectl)
Go to the Authentication tab, and click + Add a platform.
Select Mobile and desktop applications.
Add following URI:
http://localhost:53593/callback
Scroll down to Advanced settings and enable Allow public client flows.
Update Flyte Configuration - Use the following values in your Flyte Helm chart or configuration files:
Client ID: <client-id>
Client Secret: <client-secret>
Tenant ID: <tenant-id>
Redirect URI: https://<your-deployment-URL>/callback
For further reference, check out the official Azure AD Docs on how to configure the IdP for OpenIDConnect.
Note
Make sure the app is registered without additional claims. The OpenIDConnect authentication will not work otherwise, please refer to this GitHub Issue and Azure AD Docs for more information.
Apply OIDC Configuration#
Generate a random password to be used internally by
flytepropeller
Use the following command to generate a bcrypt hash for that password:
pip install bcrypt && python -c 'import bcrypt; import base64; print(base64.b64encode(bcrypt.hashpw("<your-random-password>".encode("utf-8"), bcrypt.gensalt(6))))'
Go to your values file and locate the
auth
section and replace values accordingly:
auth:
enabled: true
oidc:
# baseUrl: https://accounts.google.com # Uncomment for Google
# baseUrl: https://<keycloak-url>/auth/realms/<keycloak-realm> # Uncomment for Keycloak and update with your installation host and realm name
# baseUrl: https://login.microsoftonline.com/<tenant-id>/v2.0 # Uncomment for Azure AD
# For Okta use the Issuer URI from Okta's default auth server
baseUrl: https://dev-<org-id>.okta.com/oauth2/default
# Replace with the client ID and secret created for Flyte in your IdP
clientId: <client_ID>
clientSecret: <client_secret>
internal:
clientSecret: '<your-random-password>'
# Use the output of step #2 (only the content inside of '')
clientSecretHash: <your-hashed-password>
authorizedUris:
- https://<your-flyte-deployment-URL>
Save your changes
Upgrade your Helm release with the new values:
helm upgrade <release-name> flyteorg/flyte-binary -n <your-namespace> --values <your-values-file>.yaml
Where:
<release-name>
is the name of your Helm release, typicallyflyte-backend
. You can find it usinghelm ls -n <your-namespace>
Verify that your Flyte deployment now requires successful login to your IdP to access the UI (
https://<your domain>/console
)For
flytectl
/pyflyte
, make sure that your local config file ($HOME/.flyte/config.yaml
) includes the following option:
admin:
...
authType: Pkce #change from the default `clientCred` to enable client auth without using shared secrets
...
Generate a random password to be used internally by flytepropeller
Use the following command to generate a bcrypt hash for that password:
pip install bcrypt && python -c 'import bcrypt; import base64; print(base64.b64encode(bcrypt.hashpw("<your-random-password>".encode("utf-8"), bcrypt.gensalt(6))))'
Take note of the output (only the contents inside ‘’)
Store the
client_secret
provided by your IdP in a Kubernetes secret as follows:
kubectl edit secret -n <flyte-namespace> flyte-admin-secrets
Where flyte-namespace
is the Kubernetes namespace where you have installed Flyte.
Add a new key under
stringData
:
apiVersion: v1
# Add from here
stringData:
oidc_client_secret: <client_secret from the previous step>
# End here
data:
...
Save and close your editor.
Go to your Helm values file and verify that the
configmap
section include the following, replacing the content where indicated:
configmap:
adminServer:
server:
httpPort: 8088
grpc:
port: 8089
security:
secure: false
useAuth: true
allowCors: true
allowedOrigins:
# Accepting all domains for Sandbox installation
- "*"
allowedHeaders:
- "Content-Type"
auth:
appAuth:
thirdPartyConfig:
flyteClient:
clientId: flytectl
redirectUri: http://localhost:53593/callback
scopes:
- offline
- all
selfAuthServer:
staticClients:
flyte-cli:
id: flyte-cli
redirect_uris:
- http://localhost:53593/callback
- http://localhost:12345/callback
grant_types:
- refresh_token
- authorization_code
response_types:
- code
- token
scopes:
- all
- offline
- access_token
public: true
flytectl:
id: flytectl
redirect_uris:
- http://localhost:53593/callback
- http://localhost:12345/callback
grant_types:
- refresh_token
- authorization_code
response_types:
- code
- token
scopes:
- all
- offline
- access_token
public: true
flytepropeller:
id: flytepropeller
# Use the bcrypt hash generated for your random password
client_secret: "<bcrypt-hash>"
redirect_uris:
- http://localhost:3846/callback
grant_types:
- refresh_token
- client_credentials
response_types:
- token
scopes:
- all
- offline
- access_token
public: false
authorizedUris:
# Use the public URL of flyteadmin (a DNS record pointing to your Ingress resource)
- https://<your-flyte-deployment-URL>
- http://flyteadmin:80
- http://flyteadmin.flyte.svc.cluster.local:80
userAuth:
openId:
# baseUrl: https://accounts.google.com # Uncomment for Google
# baseUrl: https://login.microsoftonline.com/<tenant-id>/v2.0 # Uncomment for Azure AD
# For Okta, use the Issuer URI of the default auth server
baseUrl: https://dev-<org-id>.okta.com/oauth2/default
# Use the client ID generated by your IdP
clientId: <client_ID>
scopes:
- profile
- openid
Additionally, outside the
configmap
section, add the following block and replace the necessary information:
secrets:
adminOauthClientCredentials:
# If enabled is true, and `clientSecret` is specified, helm will create and mount `flyte-secret-auth`.
# If enabled is true, and `clientSecret` is null, it's up to the user to create `flyte-secret-auth` as described in
# https://docs.flyte.org/en/latest/deployment/cluster_config/auth_setup.html#oauth2-authorization-server
# and helm will mount `flyte-secret-auth`.
# If enabled is false, auth is not turned on.
# Note: Unsupported combination: enabled.false and clientSecret.someValue
enabled: true
# Use the non-encoded version of the random password
clientSecret: "<your-random-password>"
clientId: flytepropeller
Save and exit your editor.
Upgrade your Helm release with the new configuration:
helm upgrade <release-name> flyteorg/flyte-binary -n <your-namespace> --values <your-values-file>.yaml
Verify that the flytepropeller, flytescheduler and flyteadmin Pods are restarted and running:
kubectl get pods -n flyte
For flytectl/pyflyte, make sure that your local config file (
$HOME/.flyte/config.yaml
) includes the following option:
admin:
...
authType: Pkce #change from the default `clientCred` to enable client auth without using shared secrets
...
Note
For multi-cluster deployments, you must add this Secret definition block to the values-dataplane.yaml file. If you are not running flytepropeller in the control plane cluster, you do not need to create this secret there.
Note
Congratulations!
It should now be possible to go to Flyte UI and be prompted for authentication. Flytectl should automatically pickup the change and start prompting for authentication as well. If you want to use an external OAuth2 provider for App authentication, please continue reading into the next section.
References#
This collection of RFCs may be helpful to those who wish to investigate the implementation in more depth.
There’s also more detailed information about the authentication flows in the Understanding Authentication.