Azure / Azure/azure-libraries-for-java
[BUG Bash] `InteractiveBrowserCredentialBuilder` uses 0 as the default port which will not work
- Dominant language
- Java
- Stars
- 97
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
`InteractiveBrowserCredentialBuilder` uses `0` as the default port, which we can't get Azure's response.
***Exception or Stack Trace***
```
This site can’t be reachedThe webpage at http://localhost:0/?code=CODE&session_state=SESSION might be temporarily down or it may have moved permanently to a new web address.
```
**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()
.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**
SDK use an valid port as the default value or throw exception that we must specify the port first
**Setup (please complete the following information):**
- JRE Version: [e.g. Open JDK 8] Oracle JDK 8
- SDK Version: 2.0.0-SNAPSHOT
**Additional context**
N/A
**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.