Skip to content

Instantly share code, notes, and snippets.

@bachoang
Created July 20, 2019 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bachoang/f52d201787e249cc3eb82f34f53c4e00 to your computer and use it in GitHub Desktop.
Save bachoang/f52d201787e249cc3eb82f34f53c4e00 to your computer and use it in GitHub Desktop.
How to set redirect URL for OpenID Connect middleware in MVC application
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri,
RedirectUri = "https://www.contonso.com"
});
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment