Open
Description
Library version used
1.14.3
Java version
--
Scenario
Other - please specify
Is this a new or an existing app?
The app is in production, I haven't upgraded MSAL, but started seeing this issue
Issue description and reproduction steps
The context :
Third party app using MSAL4J for database Auth is trying to connect to a database using Microsoft JDBC driver.
This has been reproduced using :
- Knime Analytics platform
- DBEAVER Comminity edition
Login and navigation has been tested with
- Brave Version 1.64.109 Chromium: 123.0.6312.58 (Build officiel) (64 bits)
- Microsoft EDGE Version 123.0.2420.53 (Version officielle) (64 bits)
The flow is as follow
- App tries to connect
- Opens browser and connects to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?scope=openid+profile+offline_access+https%3A%2F%2Fdatabase.windows.net%2Fuser_impersonation&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A51355%2F
- User logs in
- The browser then does a preflight check to localhost:
- the library fails with error:
ERROR Microsoft Authentication 4:2 com.microsoft.aad.msal4j.MsalClientException: No Authorization code was returned from the server - the POST to localhost fails because socket has been closed
Relevant code snippets
No response
Expected behavior
OPTION Preflight check from the browser should be ignored and it should wait for the real POST payload
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
Things are OK if the browser does not perform preflight check