Issue with multi-tenant application and redirect uri

I have a multi-tenant application written in .NET Framework 4.8.1 that runs as a single application with different URLs for each tenant in the following format:

  • tenant1 .mydomain.com
  • tenant2 .mydomain.com
  • tenant3 .mydomain.com

The sign-in redirect URI for each tenant has been added to the application in the OKTA dashboard.

The issue we are running into is that the setup for the OKTA AspNet integration is the Startup.cs sets the redirect URI but only takes one so it is currently set to tenant1.mydomain.com/authorization-code/callback:

app.UseOktaMvc(
	new OktaMvcOptions
	{
		OktaDomain = ConfigurationManager.AppSettings["okta:OktaDomain"],
		ClientId = clientId,
		ClientSecret = ConfigurationManager.AppSettings["okta:ClientSecret"],
		AuthorizationServerId = ConfigurationManager.AppSettings["okta:AuthorizationServerId"],
		RedirectUri = ConfigurationManager.AppSettings["okta:RedirectUri"],
		PostLogoutRedirectUri = ConfigurationManager.AppSettings["okta:PostLogoutRedirectUri"],
		GetClaimsFromUserInfoEndpoint = true,
		Scope = new List<string>
		{
			"openid",
			"profile",
			"email"
		},
		LoginMode = LoginMode.SelfHosted
	});

The issue that we are running into is that users of tenant 2 and 3 are being redirected to tenant 1 and receiving log in errors. Is there any documentation on how to set the redirect uri per request or setup for this otherwise?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.