You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Authentication via OIDC works, but there does not seem to be native support for authorization. We could ship an existing provider for example for Keycloak, but we will most likely implement our own UserGroupProvider for this that uses our UserInfoFetcher.
This means that, for now, authorization has to be defined somewhere else and does not come from the OIDC provider. As an easy example, I specified an initial admin user for NiFi ("Initial User Identity 1" in authorizers.xml in the examples that follow later). If the OIDC authentication succeeds and the identity (by default email, but can be configured to any other claim by specifying nifi.security.user.oidc.claim.identifying.user) of the authenticated user matches the identity of the initial admin user, the user is now logged in to NiFi and has admin permissions. If another user with a different email address authenticates, authentication itself still works, but the user can't do anything because it is not known by NiFi. More users can for example be added by the admin user via the NiFi UI, these users are then also associated with identities of the OIDC provider upon login.
There are at least three possibilites how to configure NiFi to use OIDC for authentication:
Every OIDC user is able to login to NiFi and has the same permissions (not sure how exactly authorization works in this case, but it works). A pre-defined admin user is also able to login via API.
Only users that are known by NiFi are able to login via OIDC (e.g. an initial admin user). This user is also able to login via API. Other users can for example be added to NiFi by the initial admin user.
Every OIDC user is able to login to NiFi, but authorization is provided by a custom UserGroupProvider. We need to check how API authentication works in this case (API authentication is needed to create the reporting task that enables JVM and NiFi metrics).
The third solution is probably the best regarding the flexibility, but it needs some more research and we will most likely need to build our own UserGroupProvider.
Examples for the first two cases follow below.
Basic setup
stackablectl operator install commons=0.0.0-dev secret=0.0.0-dev nifi=0.0.0-dev zookeeper=0.0.0-dev
(I ran this on 2023-10-30, will most likely match SDP version 23.11)
If a user with the preferred_username "admin" logs in via the OIDC provider, the user is associated with the initial NiFi admin user. Since the username of the initial admin user provided in authorizers.xml is the same as in the simple-admin-credentials Secret, the "admin" user is also able to authenticate to the API via the credentials provided in that Secret.
The text was updated successfully, but these errors were encountered:
In general
Authentication via OIDC works, but there does not seem to be native support for authorization. We could ship an existing provider for example for Keycloak, but we will most likely implement our own UserGroupProvider for this that uses our UserInfoFetcher.
This means that, for now, authorization has to be defined somewhere else and does not come from the OIDC provider. As an easy example, I specified an initial admin user for NiFi ("Initial User Identity 1" in authorizers.xml in the examples that follow later). If the OIDC authentication succeeds and the identity (by default
email
, but can be configured to any other claim by specifyingnifi.security.user.oidc.claim.identifying.user
) of the authenticated user matches the identity of the initial admin user, the user is now logged in to NiFi and has admin permissions. If another user with a different email address authenticates, authentication itself still works, but the user can't do anything because it is not known by NiFi. More users can for example be added by the admin user via the NiFi UI, these users are then also associated with identities of the OIDC provider upon login.There are at least three possibilites how to configure NiFi to use OIDC for authentication:
UserGroupProvider
. We need to check how API authentication works in this case (API authentication is needed to create the reporting task that enables JVM and NiFi metrics).The third solution is probably the best regarding the flexibility, but it needs some more research and we will most likely need to build our own
UserGroupProvider
.Examples for the first two cases follow below.
Basic setup
stackablectl operator install commons=0.0.0-dev secret=0.0.0-dev nifi=0.0.0-dev zookeeper=0.0.0-dev
(I ran this on 2023-10-30, will most likely match SDP version 23.11)
Zookeeper cluster and Znode:
Admin credentials for NiFi:
Example NiFi Cluster for the first configuration variant ("Every OIDC user is able to login to NiFi"):
Example NiFi Cluster for the second configuration variant ("Only users that are known by NiFi are able to login via OIDC")
Define authorizers:
Mount this file in our NiFi cluster:
If a user with the
preferred_username
"admin" logs in via the OIDC provider, the user is associated with the initial NiFi admin user. Since the username of the initial admin user provided inauthorizers.xml
is the same as in thesimple-admin-credentials
Secret, the "admin" user is also able to authenticate to the API via the credentials provided in that Secret.The text was updated successfully, but these errors were encountered: