Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.98k forks source link

[FEATURE REQ] Support passwordless connection for Azure Redis cache in Spring #31350

Closed saragluna closed 1 year ago

saragluna commented 2 years ago

Is your feature request related to a problem? Please describe. For Spring Cloud Azure 4.x, we started to support passwordless connection to 1st and 3rd party Azure Services. So far, we have provided passwordless connection support to Azure Event Hubs for Kafka, Azure database for MySQL, Azure database for PostgreSQL. Now, we would like to enlarge the scope to Azure Cache for Redis.

Describe the solution you'd like Deliver a feature spec for the passwordless support to Redis with Spring framework. The feature spec should cover all customer-aware information about our spring Redis support library

Scopes:

Describe alternatives you've considered N/A

Additional context N/A

Information Checklist

yiliuTo commented 2 years ago

https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity/src/samples/Azure-Cache-For-Redis

yiliuTo commented 2 years ago

https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/src/samples/Azure-Cache-For-Redis/Lettuce/Azure-AAD-Authentication-With-Lettuce.md

stliu commented 1 year ago

about the scope, I think we should only cover jedis and lettuce, those two are supported by spring-data-redis, https://spring.io/projects/spring-data-redis I don't see it support redission

though Redission has spring support but I think we can consider that later and wait for more customer ask for it

saragluna commented 1 year ago

PoC for Spring Boot 3 + Lettuce 6.2 https://github.com/Azure/azure-sdk-for-java/issues/31972#issuecomment-1336959343.

backwind1233 commented 1 year ago

Updates: We will not provide the feature that users can provide their own tokenCredential bean to build AzureRedisCredentialSupplier in this PR.

backwind1233 commented 1 year ago

Updates

Functional Updates

Non-Functional Updates

Updates on 2023-01-31

Milestone ETA Goal Issue
Milestone 1 -- Jan Support Spring Boot 2.x + Jedis https://github.com/Azure/azure-sdk-for-java/issues/31350
Milestone 2 -- April Connect to multiple Azure Redis servers https://github.com/Azure/azure-sdk-for-java/issues/33227
Milestone 3 -- June 23 Support Spring Boot 3 + Lettuce https://github.com/Azure/azure-sdk-for-java/issues/33228
Milestone 4 -- July 23 Support Spring Boot 3.1 + Jedis https://github.com/Azure/azure-sdk-for-java/issues/33229
Milestone 5 -- Dec 23 Support native images https://github.com/Azure/azure-sdk-for-java/issues/33230
backwind1233 commented 1 year ago

Closing this issue, due to the PR has been merged to main.

backwind1233 commented 1 year ago

Updates

There are breaking changes from the Azure redis server side.

Before: Client side use username and Azure AD issued token(as the password) to create connections. After connections created, it doesn't matter if the token expires.

After: Client side use username and Azure AD issued token(as the password) to create connections. Client side need send auth command with refreshed token to redis server before the token expires.

backwind1233 commented 1 year ago

Updates

There will be breaking changes from the Azure redis server side.

Before: Username for AUTH command is resource name.

After: Username for AUTH command would be AAD objectId (for example, Service Principal Object Id in case AAD App is used) instead of resource name.