Authenticate Users via OpenID Connect

Note

OpenID Connect Authentication is a Flower Enterprise feature. See Flower Enterprise for details.

In this guide, you'll learn how to configure SuperLink with user-level authentication and authorization, and how to log in using the flwr CLI. Once logged in, any users that are authorized on the SuperLink can run Flower CLI commands that interact with the SuperLink.

Important

With user authentication and authorization enabled, only users that have submitted the flwr run command can view and interact with their runs. This means that your runs are private by default, ensuring that only authorized users can access them.

先决条件

To enable user authentication and authorization, the SuperLink must be deployed with an OpenID Connect (OIDC) provider and an OpenFGA server. The OIDC provider is used for user authentication, while OpenFGA is used for fine-grained access control. This means an authenticated user can only run flwr CLI commands on the SuperLink if they have been granted the necessary permissions by the SuperLink administrator. When enabled, both user authentication and authorization must be configured on the SuperLink.

Run authorized flwr CLI commands

With the above steps completed, you can now run flwr CLI commands against a SuperLink setup with user authentication and authorization. For example, as an authorized user, you can run the flwr run command to start a Flower app:

 flwr run
Loading project configuration...
Success
🎊 Successfully built flwrlabs.myawesomeapp.1-0-0.014c8eb3.fab
🎊 Successfully started run 1859953118041441032

If the user does not have the necessary permissions to run the command, an error will be returned:

 flwr run
Loading project configuration...
Success
❌ Permission denied.
User not authorized