Skip to content

Commit 4d8d9be

Browse files
authored
Rewrite http protocol to https for DSI redirect (#34)
within ACA a container runs on http, though available as https this causes the OIDC redirect_url to have the http protocol, rather than https DSI does not allow http. The following changes rewrites the URL, SAB-328
1 parent 9e8fa13 commit 4d8d9be

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/SchoolAccount.Web.Mvc/Authentication/Extensions/ServiceCollectionExtensions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ IConfigurationManager configuration
5353
context.HttpContext.Session.Clear();
5454
await Task.CompletedTask;
5555
},
56+
// within ACA a container runs on http, though available as https publicly
57+
// this causes the OIDC redirect_url to have the http protocol, rather than https
58+
// DSI does not allow http redirect URLS. The following corrects the URL
59+
OnRedirectToIdentityProvider = async n =>
60+
{
61+
n.ProtocolMessage.RedirectUri = n.ProtocolMessage.RedirectUri.Replace(
62+
"http://",
63+
"https://"
64+
);
65+
await Task.CompletedTask;
66+
},
5667
};
5768
});
5869

0 commit comments

Comments
 (0)