-
Hi there, Im using Microsoft Identity( AddMicrosoftWebAppAuthentication) to authenticate users. So i can goto https://east.myorg.com and https://west.myorg.com and get authenticated. Now the CDN has to rewrite the the HOST header so that the request gets routed internally ( not sure if this is part of the problem or not) but when i goto https://mycdn.myorg.com that presents both east and west sites , i get routed to https://east(or west).mysite.org/signin-oidc. When using AddMicrosoftAccount you can use the events to control the redirect url, however i cant find the secret sauce to do similar with AddMicrosoftWebAppAuthentication. Any ideas? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Does the cdn forward you the original host header? E.g. "x-forwarded-host: mycdn.myorg.com"? See the proxy docs for fixing up the host on the request rather than trying to customize the redirect. |
Beta Was this translation helpful? Give feedback.
-
Hi Chris, yes is does and have double checked with a controller that just outputs the headers. Ive even tried some middleware that updates the host to x-forwarded-host. When i do that i get `An unhandled exception occurred while processing the request. Exception: An error was encountered while handling the remote login. Im not sure if thats a step backwards or forwards :) |
Beta Was this translation helpful? Give feedback.
Hi Chris, yes is does and have double checked with a controller that just outputs the headers. Ive even tried some middleware that updates the host to x-forwarded-host. When i do that i get
`An unhandled exception occurred while processing the request.
Exception: Unable to unprotect the message.State.
Unknown location
Exception: An error was encountered while handling the remote login.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync()`
Im not sure if thats a step backwards or forwards :)