<@U06RKAMK0UC> Can you show an example of FlyteRem...
# ask-ai
b
@ancient-wolf-19325 Can you show an example of FlyteRemote with authentication enabled on a remote server
j
To set up
FlyteRemote
with authentication enabled on a remote server, you need to configure the
FlyteRemote
object with the appropriate authentication details. Here's an example using client credentials for authentication:
Copy code
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config, PlatformConfig

remote = FlyteRemote(
    config=Config(
        platform=PlatformConfig(
            endpoint="https://your-flyte-endpoint.com",
            client_id="your-client-id",
            client_credentials_secret="your-client-secret",
            auth_mode="client_credentials",
        ),
    ),
    default_project="flytesnacks",
    default_domain="development",
)
Ensure that your Flyte deployment is configured to use the same client ID and client secret. The
endpoint
should be the URL of your Flyte backend. Would you like more detailed guidance on setting up the configuration file or troubleshooting this issue further? Sources: - FlyteRemote Documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
b
This gives
Copy code
File "/usr/local/lib/python3.11/site-packages/flytekit/clients/auth/authenticator.py", line 213, in __init__
        raise ValueError("Client ID and Client SECRET both are required.")
@ancient-wolf-19325 This gives
Copy code
File "/usr/local/lib/python3.11/site-packages/flytekit/clients/auth/authenticator.py", line 213, in __init__
        raise ValueError("Client ID and Client SECRET both are required.")
j
The error indicates that both the
client_id
and
client_credentials_secret
are required for authentication. Ensure that both values are correctly provided in the configuration. Here's an updated example:
Copy code
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config, PlatformConfig

remote = FlyteRemote(
    config=Config(
        platform=PlatformConfig(
            endpoint="https://your-flyte-endpoint.com",
            client_id="your-client-id",
            client_credentials_secret="your-client-secret",
            auth_mode="client_credentials",
        ),
    ),
    default_project="flytesnacks",
    default_domain="development",
)
Make sure that
your-client-id
and
your-client-secret
are correctly set and match the credentials configured in your Flyte deployment. Would you like more detailed guidance on setting up the configuration file or troubleshooting this issue further? Sources: - https://github.com/flyteorg/flyte/issues/5021 - https://github.com/flyteorg/flyte/issues/2738 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.