1IM OAUTH with Azure as IDP

Hello,

We are trying to configure oauth in 1im with azure as IDP. Post the config, when we try to access 1IM URL we see the error

"<servername> redirected you too many times"

If we refresh the same page, we're seeing the error below

2020-04-21 15:06:29.4677 ERROR ( ObjectLog ok2tfqdminovlszpfszysqqg) : 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)

We have configured scopes openid profile. Search value is upn fetching from person defaultemailaddress. Appreciate any input to fix this

Thanks in advance