Search code examples
openiddict

Register multiple RedirectUris


Sometimes a client has more than one redirect uri. We want to be able to register multiple RedirectUri values. How, if at all, do we do that?

context.Applications.Add(new OpenIddictApplication
{
    ClientId = "zamboni-app",
    ClientSecret = Crypto.HashPassword("secret_secret_secret"),
    DisplayName = "Zamboni app",
    LogoutRedirectUri = "http://zamboni-app.azurewebsites.net/signout-oidc",
    RedirectUri = "http://zamboni-app.azurewebsites.net/signin-oidc",
    Type = OpenIddictConstants.ClientTypes.Public
});

Solution

  • EDIT: support for multiple redirect_uri has been added in the RTM version of OpenIddict. My original recommendation still applies: please don't use this ability to create "mega clients" that span multiple domains/security boundaries.


    Specifying multiple redirect_uri is deliberately not supported by OpenIddict to deter you from reusing the same client registration (read client_id) for all your apps.