Thanks for the tip!
I had to make one small change because my callback path was "/signin-microsoft"
On the RegEx I modified it to the following:
Regex.Replace(context.RedirectUri, "redirect_uri=(.)+%2Fsignin-", "redirect_uri=https%3A%2F%2Fwww.yourcustomdomain.com%2Fsignin-")
Note the "signin-" instead of "signin-oidc"