ecodina opened a new issue, #75857:
URL: https://github.com/apache/airflow/issues/75857
### Under which category would you file this issue?
Providers
### Apache Airflow version
3.3.2
### What happened and how to reproduce it?
We use the Keycloak provider configured following the docs. We recently
upgraded to Keycloak 26.8.1, and in there we are seeing this warning:
```
WARN [org.keycloak.protocol.oidc.grants.ClientCredentialsGrantType]
(executor-thread-1327) Client 'airflow' in the realm 'internal' has enabled
switch 'Use refresh tokens for client credentials grant'. The switch is
deprecated and will be removed in the future version. It is recommended to
disable the switch and update your client application to not rely on this
switch being enabled
```
I have tried disabling it (Clients -> Airflow -> Advanced -> OpenID Connect
Compatibility Modes -> Use refresh tokens), but then Airflow throws an Internal
Error. The logs of this error are:
```
Traceback (most recent call last):
File ".../uvicorn/protocols/http/httptools_impl.py", line 422, in run_asgi
File ".../uvicorn/middleware/proxy_headers.py", line 63, in __call__
File ".../fastapi/applications.py", line 1159, in __call__
File ".../starlette/applications.py", line 96, in __call__
File ".../starlette/middleware/errors.py", line 186, in __call__
File ".../starlette/middleware/errors.py", line 164, in __call__
File ".../starlette/middleware/cors.py", line 88, in __call__
File ".../airflow/api_fastapi/common/http_access_log.py", line 109, in
__call__
File ".../starlette/middleware/gzip.py", line 78, in __call__
File ".../starlette/middleware/gzip.py", line 103, in __call__
File ".../starlette/middleware/base.py", line 198, in __call__
File ".../starlette/middleware/base.py", line 144, in coro
File ".../starlette/middleware/base.py", line 198, in __call__
File ".../starlette/middleware/base.py", line 144, in coro
File ".../starlette/middleware/exceptions.py", line 63, in __call__
File ".../starlette/_exception_handler.py", line 53, in wrapped_app
File ".../starlette/_exception_handler.py", line 42, in wrapped_app
File ".../fastapi/middleware/asyncexitstack.py", line 18, in __call__
File ".../starlette/routing.py", line 670, in __call__
File ".../starlette/routing.py", line 690, in app
File ".../starlette/routing.py", line 455, in handle
File ".../fastapi/applications.py", line 1159, in __call__
File ".../starlette/applications.py", line 96, in __call__
File ".../starlette/middleware/errors.py", line 186, in __call__
File ".../starlette/middleware/errors.py", line 164, in __call__
File ".../starlette/middleware/exceptions.py", line 63, in __call__
File ".../starlette/_exception_handler.py", line 53, in wrapped_app
File ".../starlette/_exception_handler.py", line 42, in wrapped_app
File ".../fastapi/middleware/asyncexitstack.py", line 18, in __call__
File ".../starlette/routing.py", line 670, in __call__
File ".../starlette/routing.py", line 690, in app
File ".../starlette/routing.py", line 280, in handle
File ".../fastapi/routing.py", line 134, in app
File ".../starlette/_exception_handler.py", line 53, in wrapped_app
File ".../starlette/_exception_handler.py", line 42, in wrapped_app
File ".../fastapi/routing.py", line 120, in app
File ".../fastapi/routing.py", line 674, in app
File ".../fastapi/routing.py", line 330, in run_endpoint_function
File ".../starlette/concurrency.py", line 34, in run_in_threadpool
File ".../anyio/to_thread.py", line 65, in run_sync
File ".../anyio/_backends/_asyncio.py", line 2706, in
run_sync_in_worker_thread
File ".../anyio/_backends/_asyncio.py", line 1100, in run
File ".../airflow/providers/keycloak/auth_manager/routes/login.py", line
126, in login_callback
KeyError: 'refresh_token'
```
The "fix" looks simple: make the refresh_token optional in file `login.py`.
However, will this break the provider?
### What you think should happen instead?
_No response_
### Operating System
_No response_
### Deployment
None
### Apache Airflow Provider(s)
keycloak
### Versions of Apache Airflow Providers
apache-airflow-providers-keycloak | 0.11.0
### Official Helm Chart version
Not Applicable
### Kubernetes Version
_No response_
### Helm Chart configuration
_No response_
### Docker Image customizations
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]