KKIEEK opened a new pull request, #50921:
URL: https://github.com/apache/airflow/pull/50921

   While setting up RBAC with [dex](https://github.com/dexidp/dex) in a k8s 
cluster, I found that support for OIDC providers in Airflow is hardcoded. So I 
just added simple fallback mechanism to handle unregistered ones.
   
   ### References:
   - 
[`OpenIDMixin.userinfo`](https://github.com/authlib/authlib/blob/036a0b71532ada9371f0fc41f6bcd2287666bb20/authlib/integrations/base_client/sync_openid.py#L28)
   - 
[`UserInfo`](https://github.com/authlib/authlib/blob/036a0b71532ada9371f0fc41f6bcd2287666bb20/authlib/oidc/core/claims.py#L222)
   
   ### Example w/ dex:
   ```yaml
   webserverConfig: |
       from flask_appbuilder.security.manager import AUTH_OAUTH
   
       AUTH_TYPE = AUTH_OAUTH
   
       AUTH_USER_REGISTRATION = True
       AUTH_USER_REGISTRATION_ROLE = "User"
   
       OAUTH_PROVIDERS = [
           {
               "name": "dex",
               "icon": "fa-circle",
               "token_key": "access_token",
               "remote_app": {
                   "client_id": "airflow",
                   "client_secret": "...",
                   "client_kwargs": {
                       "scope": "openid profile email groups"
                   },
                   "api_base_url": "https://www.domain.com";,
                   "access_token_url": "https://www.domain.com/token";,
                   "authorize_url": "https://www.domain.com/auth";,
                   "userinfo_endpoint": "https://www.domain.com/userinfo";,
                   "server_metadata_url": 
"https://www.domain.com/.well-known/openid-configuration";,
               },
           },
       ]
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to