Authentication fails on web portal with Azure Open ID

Hello all,

We have set up the web portal to authenticate through our Azure IDP. When the user login on the web portal (8.1.1) the redirection to the IDP login page is ok, the credentitials validation is ok, but when the IDP redirect the user to the web application we have this message :

Failed to authenticate user.
A task was canceled.
Here are the logs in the web server :

2021-08-02 14:25:25.0284 ERROR ( ObjectLog mhde1h52bigzsx2locfuabu3) : Failed to authenticate user using OAuth2/Open ID Connect. System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<_GetTokenAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetClaimsAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetPersonDataAsync>d__24.MoveNext()    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<_GetTokenAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetClaimsAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetPersonDataAsync>d__24.MoveNext()
2021-08-02 14:25:25.0597 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : Opening database session in mode ReadWrite
2021-08-02 14:25:25.1065 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : -- Connection 2 switched from Available to Working after comparison
2021-08-02 14:25:25.1065 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : --> existing connection 2
2021-08-02 14:25:25.1065 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : (< 1 ms) - Pin DbSession to physical connection
2021-08-02 14:25:25.1065 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : Incremented pin count to 1
2021-08-02 14:25:25.1065 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : (6 ms) - BEGIN TRANSACTION
2021-08-02 14:25:25.1065 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : Increment transaction count to 1
2021-08-02 14:25:25.1378 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : ClaimConnectionAsync - read write, _transaction == 33390380
2021-08-02 14:25:25.1378 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : ClaimConnectionAsync: Lock aquired on connection 2
2021-08-02 14:25:25.1378 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : ClaimConnectionAsync: Use the transaction
2021-08-02 14:25:25.1534 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : (9 ms) - insert into DialogJournal (UID_DialogJournal, ApplicationName, LogonUser, MessageDate, MessageString, MessageType, Hostname) values ('02e4c524-b66f-427e-8917-d7eb5615757d', N'/LM/W3SVC/2/ROOT/IdentityManager-1-132723617951677658', N'TERA-INT\SVC_FARO-1IM-WEB001', '2021-08-02 12:25:25.075', N'#LDS#Login failed (Module: {0}, Properties: {1}, Identity: {3}, Client Machine: {4}, Errors: {2})|OAuth 2.0 / OpenID Connect (role based)||[System.Threading.Tasks.TaskCanceledException] A task was canceled.|-|10.252.40.179', N'W', N'TH3INTTIAM009')
2021-08-02 14:25:25.1534 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : ClaimConnectionAsync: Releasing lock on connection 2
2021-08-02 14:25:25.1690 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : Decrement transaction count to 0
2021-08-02 14:25:25.1847 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : (13 ms) - COMMIT TRANSACTION
2021-08-02 14:25:25.1847 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : (84 ms) - Physical Transaction
2021-08-02 14:25:25.2003 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : Decremented pin count to 0
2021-08-02 14:25:25.2003 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : (93 ms) - Pinned physical connection
2021-08-02 14:25:25.2003 TRACE (    SqlLog mhde1h52bigzsx2locfuabu3) : -- Connection 2 switched from Working to Available
2021-08-02 14:25:25.2003 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : Closing database session.
2021-08-02 14:25:26.2015 DEBUG ( ObjectLog mhde1h52bigzsx2locfuabu3) : Opening session done in 101,27s.
2021-08-02 14:25:26.2015 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : Closing database session.
2021-08-02 14:25:26.2015 DEBUG (    SqlLog mhde1h52bigzsx2locfuabu3) : Opening database session in mode ReadWrite
2021-08-02 14:25:26.2015 TRACE (    WebLog mhde1h52bigzsx2locfuabu3) :         NotifyExecute: VI_Common_Login, Container19
2021-08-02 14:25:26.2171 TRACE (    WebLog mhde1h52bigzsx2locfuabu3) :         NotifyExecute: VI_Common_Login, Label4
2021-08-02 14:25:26.2171  WARN (    WebLog mhde1h52bigzsx2locfuabu3) : One or more errors occurred. System.AggregateException: One or more errors occurred. ---> VI.Base.ViException: Failed to authenticate user. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<_GetTokenAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetClaimsAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetPersonDataAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Auth.AuthModRoleBasedBase.<AuthenticateAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Auth.DbAuthenticator.<AuthenticateAsync>d__10.MoveNext()
   --- End of inner exception stack trace ---
   at VI.DB.Auth.DbAuthenticator.<AuthenticateAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Entities.SessionFactoryImpl.<>c__DisplayClass15_0.<<OpenAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Entities.SessionFactoryImpl.<_OpenAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Entities.SessionFactoryImpl.<OpenAsync>d__15.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at VI.Base.SyncActions.Do[T](Func`1 function)
   at VI.DB.Implementation.Connection.Authenticate(IAuthProps props)
   at VI.WebRuntime.UserSession.HandleLogin(IAuthPropCollector auth)
   at VI.WebRuntime.UserSession.Authenticate(IAuthPropCollector auth)
   at VI.WebRuntime.VI_StandardWeb.VI_Common_Login.InitComponent(Control _parentControl, CancellationToken ct)
---> (Inner Exception #0) VI.Base.ViException: Failed to authenticate user. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<_GetTokenAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetClaimsAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at QER.OAuthAuthentifier.OAuth.<GetPersonDataAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Auth.AuthModRoleBasedBase.<AuthenticateAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Auth.DbAuthenticator.<AuthenticateAsync>d__10.MoveNext()
   --- End of inner exception stack trace ---
   at VI.DB.Auth.DbAuthenticator.<AuthenticateAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Entities.SessionFactoryImpl.<>c__DisplayClass15_0.<<OpenAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Entities.SessionFactoryImpl.<_OpenAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at VI.DB.Entities.SessionFactoryImpl.<OpenAsync>d__15.MoveNext()<---
    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at VI.Base.SyncActions.Do[T](Func`1 function)
   at VI.DB.Implementation.Connection.Authenticate(IAuthProps props)
   at VI.WebRuntime.UserSession.HandleLogin(IAuthPropCollector auth)
   at VI.WebRuntime.UserSession.Authenticate(IAuthPropCollector auth)
   at VI.WebRuntime.VI_StandardWeb.VI_Common_Login.InitComponent(Control _parentControl, CancellationToken ct)

I really have no clues on this one.

Best regards,