Azure / Azure/azure-libraries-for-java

[BUG Bash] `InteractiveBrowserCredentialBuilder` uses 0 as the default port which will not work

Aperta
#1,219 3 commenti 0 reazioni 1 assegnatario Rivendicata da @weidongxu-microsoft Vedi su GitHub
Mgmt v2 v2 GA
Lingua principale
Java
Stelle
97
Fork
102
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.