Azure / Azure/azure-libraries-for-java
[BUG Bash] Azure client authenticated with InteractiveBrowserCredential keep running after main method
- Dominant language
- Java
- Stars
- 97
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Codes with Azure client authenticated with `InteractiveBrowserCredential` keep running after main method done.
**To Reproduce**
Steps to reproduce the behavior:
Run codes in *Code Snippet*
***Code Snippet***
Add the code snippet that causes the issue.
``` java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
TokenCredential credential = new InteractiveBrowserCredentialBuilder()
.port(8081)
.clientId("CLIENT_ID").build();
Azure azure = Azure
.authenticate(credential, profile)
.withSubscription("SUBSCRIPTION");
for (Subscription subscription : azure.subscriptions().list()) {
System.out.println(subscription.displayName());
}
```
**Expected behavior**
Program should exit automatically after main method done.
**Setup (please complete the following information):**
- JRE Version: [e.g. Open JDK 8] Oracle JDK 1.8.0_241
- SDK Version: [e.g. 2.0.0-SNAPSHOT] 2.0.0-SNAPSHOT
**Additional context**
Besides, is there any method to set the redirect page content after user authenticated in browser? For now it's an empty page without auto close.
**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
- [x] Bug Description Added
- [x] Repro Steps Added
- [x] Setup information Added
Contributor guide
Assessment
This issue has not been assessed yet.