HedgeDoc + AzureAD

My version of HedgeDoc is: 1.9.2

What I expected to happen:

I try to login with OAuth2.0 over AzureAD to HedgeDoc. It fails with an “Internal Server Error”.

What actually happened:

  1. Login over Oauth 2.0
  2. Microsoft Login popup
  3. Microsoft Login successfull
  4. Redirect to https://hedgedoc..com/auth/oauth2/callback?code=&state=&session_state=
  5. HedgeDoc shows white page with “Internal Server Error”

I already tried:

Everything

Hello,

Have you checked the log files? Could you please provide the log?

InternalOAuthError: Failed to fetch user profile
at /hedgedoc/lib/web/auth/oauth2/index.js:97:19
at ClientRequest. (/hedgedoc/node_modules/oauth/lib/oauth2.js:162:5)
at ClientRequest.emit (node:events:514:28)
at Socket.socketErrorListener (node:_http_client:495:9)
at Socket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2024-02-14T14:52:44.348Z info: 172.68.51.50 - - [14/Feb/2024:14:52:44 +0000] “GET /auth/oauth2/callback?code=0.ATEAjd_a3wUI4Uya0UuMWpn7Lakixk9I7s9Lh60WjN-zkscZAe8.AgABAAIAAAAmoFfGtYxvRrNriQdPKIZ-AgDs_wUA9P8Qyi_LRP9_m81aZCeb6ER0AFuEQQr2lD8rWs2PMt9sl1Wrz7dysjNYQP05caJuBZN8woDjgB4fP7PvLMmAeg4OGeCWuNV2oTkiaaQU_BuY-SOPbL81eiqX1gMPdsM6HnoLdwYA__FGJr5-qJwOOWAym7IJGY0QEJsdkqeJjjEtljRsSz0Q3N3VzbE5PhBg61TZij2QS2myiZIGAt3vVdu6RPZUUqrp3m8oEd0V5mQF7fTHyMH7VRDJMP-NkMe2j1dINHgHX0t0LqNWXJ_4YyIaDNeTtHo6I0qYeV7vcGCiToCgymgA5y735vOTh_vGouK6qTTvpxUILX63WWmttuYyv_Jc7t9mWNPKe5MW8UnPncRfLpdxLpOHmtethmuQNcTto7v3thIezkJJQJW5gPJNz7xbe8HtR0iEqaeinCH_whOCf2z-rkEWBO6Lp0Xh-tmkBndWMtBOgv83EHjfXaK9q0k99vib6FshQE9WBU8kRF__1yBNDlYJYmZfIVePqjrIZu9EncE_zVqE2OXTNHSXl6CJlfud4TgfDsPSQfaHes6k4_Y6_HCfxUVKFCVVL984ryyz_moX9flES-x8HZUVsrxsYR4iLjdpD-AU7L0jfD2K_7Z_02JaEfTuY7QiUVAZ2B1OdFqxYzXQJR-smJwfPUbM6y61lvNOYRjpljP7ZR2Ig9IhUCaoJh52S5OK14XLBivtguJXCl9oAKz9JMcD9YTbwrHOADrfpQU839FZ64zDT_BoaA4Wq97ErBhnux7Y-QcHhRdBMftMkWzVbfuIkEJLiSJw5Cl4BcJSrb3Gi8zHF533vLI_g2JJz-MxnIrFT7_b7579VZzKEkpD-jFE5pY3r38-p3pvyuDA_BXJLXPARIkrx_gJc76YKm6H_YI87CA6A-B-cxsen5B0vUggdFZRWmCUsvKL0q74_wYA945Dz1iJEvbBKutxHXgIxHBHzd9uL3noJOjkAbAuN8mruyLXGjh3lJSvwmiywF9G1dUT7fC5-Kog&state=DdvsCrGjOIKFIH8pRJkpZiCW&session_state=032b7fee-f2fe-4c97-9d9f-98a9fd9e5961 HTTP/1.1” 500 148 “https://login.microsoftonline.com/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36”