title: Java: Is there any way to get context of single sign on done on local system through code?
body: <p>My company uses multiple applications and single sign on using Microsoft login.</p>
  <p>In my browser, I already login to application but when run incognito mode, it again ask for login and MFA.</p>
  <p>Now i want to download the image in that application</p>
  <pre><code>try(InputStream in = new URL(&quot;https://bhuwhatwhere.tie.com/EmployeeImages/Profiles/AAHLENIU.jpg&quot;).openStream()){
          Files.copy(in, Paths.get(&quot;C://Integrator//AAHLENIU.jpg&quot;));
      }
  </code></pre>
  <p>It returns on my local:</p>
  <pre><code>Copyright (C) Microsoft Corporation. All rights reserved. --&gt;&lt;!DOCTYPE html&gt;&lt;html dir=&quot;ltr&quot; class=&quot;&quot; lang=&quot;en&quot;&gt;&lt;head&gt; &lt;title&gt;Sign in to your account&lt;/title&gt;
  All these url's return microsoft sign in page.
  </code></pre>
  <p>Is there way to download file using same browser contexts; either doing some registry changes (or do i need oauth etc.)? Because there are 4000 images and download single is mess.</p>