Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support microsoft entra id for authentication with azure cache for redis #386

Open
dimbleby opened this issue Apr 17, 2024 · 1 comment
Open

Comments

@dimbleby
Copy link

Azure cache for redis supports authentication using microsoft entra tokens, it would be great if I could make use of that with django + channels

https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-azure-active-directory-for-authentication#microsoft-entra-client-workflow describes what the client needs to do

presumably would need a bit of extra configuration ENTRA_USER or somesuch, and logic per that link.

I am afraid I am unlikely to contribute this myself but open this anyway in case either: you want to shut it down immediately or, more optimistically, it catches the attention of someone who would like to implement it.

@bbrowning918
Copy link
Contributor

bbrowning918 commented Apr 23, 2024

channels_redis only passes along what each hosts entry is to the redis async client if it is a dictionary (ignoring the address or tuple shortcut).

Much of the headache comes from managing reauthentication, as otherwise they state to pass in the Object ID and the Entra token as username and password respectively.

Passing in a credential_provider that handles the token refresh should be a good start. I am unsure how to handle the required AUTH call to Redis itself. Perhaps health_check_interval or retry but that is deeper into redis-py than I am familiar with. Asking in redis-py itself might provide a better answer (I came up empty looking for Entra related things 😞).

channels_redis isn't quite the layer that is at fault here, but with the correct dictionary passed into hosts (for redis-py to use) everything should be happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants