Issue with Okta Call back to API service through Azure APIM

Hello Team,

I am having an API service deployed on Azure Web APP, and we are managing API end points through Azure API management services (APIM).

We have a Angular app, communicating to SignIn API through APIM to generate JWT token (Customized token) along with Okta Token. Getting below error after successful authentication through Okta login widget while navigating to Call back url. Please suggest

2023-08-11 14:49:35.252 +00:00 [Error] Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: An unhandled exception has occurred while executing the request.System.Exception: An error was encountered while handling the remote login.—> System.Exception: Correlation failed.— End of inner exception stack trace —at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

.

It might be an issue with the path of the cookies as it’s mentioned in: c# - System.Exception: Correlation failed when posting back to /signin-oidc after migrating from app service to AKS - Stack Overflow

@shrery, Its not cookies specific seems to be. Actually, Angular APP is calling API endpoint through Azure API management to Authenticate but call back path is pointing to Azure Web APP where actual API is deployed and seems issue because two different paths but not sure how to fix that.