InteractiveBrowserCredentialBuilder : Unable to open default system browser

Srini Babu Maroju 21 Reputation points


This is about azure active directory authentication, connect to storage container using spring boot application.

I am running spring boot application in my local machine. The port is 8080. When user types url(http://localhost:8080/DisplayPDF) in browser, it needs to pop up authentication screen and after successfully authentication screen, it should render a file in Storage container.

My Code is is

InteractiveBrowserCredential interactiveBrowserCredential = new InteractiveBrowserCredentialBuilder()

    BlobServiceClient storageClient = new BlobServiceClientBuilder().endpoint(endpoint)

I am getting error as below. Can you please advise ? Unable to open default system browser
at ~[msal4j-1.8.0.jar:1.8.0]
at ~[msal4j-1.8.0.jar:1.8.0]
at ~[msal4j-1.8.0.jar:1.8.0]
at ~[msal4j-1.8.0.jar:1.8.0]
at ~[msal4j-1.8.0.jar:1.8.0]
at java.base/java.util.concurrent.CompletableFuture$ ~[na:na]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec( ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.doExec( ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec( ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool.scan( ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool.runWorker( ~[na:na]
at java.base/ ~[na:na]

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,771 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 29,631 Reputation points Microsoft Employee

    @Srini Babu Maroju
    Thank you for your post and I apologize for the delayed response!

    For your error message, it looks like there's an issue opening your default browser? Have you had the chance to look through our MSAL.NET - How to use the Default OS Browser documentation?

    MSAL.NET needs to listen on http://localhost:port and intercept the code that AAD sends when the user is done authenticating (See Authorization code for details)To enable the system browser:

    During app registration, configure http://localhost as a redirect uri (not currently supported by B2C)
    When you construct your PublicClientApplication, specify this redirect uri:

    IPublicClientApplication pca = PublicClientApplicationBuilder  
                                 // or use a known port if you wish "http://localhost:1234"  

    If you configure http://localhost, internally MSAL.NET will find a random open port and use it.

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.


    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments