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.3k stars 1.96k forks source link

[FEATURE REQ] Add getBearerTokenProvider() method that return a callback to get token in Azure Identity #41611

Open mssfang opened 2 weeks ago

mssfang commented 2 weeks ago

Is your feature request related to a problem? Please describe.

Python and JavaScript Azure Identity SDK have a method getBearerTokenProvider that returns a callback, Supplier<String> in Java.

Python: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/azure/identity/_bearer_token_provider.py

JavaScript: https://github.com/Azure/azure-sdk-for-js/blob/c0b9ee632230a89a54820269e133f7719cdc9f4b/sdk/identity/identity/src/tokenProvider.ts#L47

Describe the solution you'd like

We can add a similar public API in Azure Identity SDK for Java:

Supplier<String> getBearerTokenProvider(TokenCredential credential, String scope)

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

github-actions[bot] commented 2 weeks ago

@billwert @g2vinay

github-actions[bot] commented 2 weeks ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.