Base solution for your next web application
Open Closed

Subdomain support on Public site #5563


User avatar
0
leop created

I'm having issues with redirects to public site after logging in when I have subdomains configured on Public site.

Public site config: App:WebSiteRootAddress = https://{TENANCY_NAME}.pub.mysite.com/ App:AdminWebSiteRootAddress = https://{TENANCY_NAME}.mvc.mysite.com/

MVC site config: App:WebSiteRootAddress = https://{TENANCY_NAME}.mvc.mysite.com/ App:RedirectAllowedExternalWebSites = https://{TENANCY_NAME}.pub.mysite.com/

When I navigate to Public home page and do a Login, it navigates to MVC site to render login UI, but does NOT return to the Public site after login. The URL does show a correct returnUrl in the query string (e.g. <a class="postlink" href="https://tenant.mvc.mysite.com/account/login?ss=true&returnUrl=https://tenant.pub.mysite.com/Account/Login">https://tenant.mvc.mysite.com/account/l ... ount/Login</a>)

Does Public site support {TENANCY_NAME} subdomains? I'm using version 5.6

Thanks.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Can you jump correctly when you don't use {TENANCY_NAME}?

  • User Avatar
    0
    leop created

    Yes, before I added subdomain config redirects worked fine.

    It seems Public site is detecting tenant name correctly from subdomain, but redirect after login is not working.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @leop can you view the public website if you use subdomain on the url ? I mean what happens when you try to visit <a class="postlink" href="https://tenant.pub.mysite.com/">https://tenant.pub.mysite.com/</a> on your browser directly ? Does it work ?

  • User Avatar
    0
    leop created

    Hi ismcagdas, if I navigate to Public site with tenant subdomain, the page shows up fine, everything appears to work OK in regards to detecting tenant on Public site.

    It seems the problem is on MVC site with App:RedirectAllowedExternalWebSites setting when public site is configured to support subdomains.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @leop.

    I got it now. Could you create an issue here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/new">https://github.com/aspnetzero/aspnet-ze ... issues/new</a> ? We will fix the problem.