Base solution for your next web application
Open Closed

Subdomain Authentication #5935


User avatar
0
shimi created

Our Application is divided into three modules with three subdomains we want to communite authentication to diffrent subdomains how can we acheive this using Angular Template.

eg: Login will be done from login.maindomain.com then a screen with different module appears if user clicks on accounts button user will be redirected to accounts.maindomain.com with out relogin. Database is same for all domains.


3 Answer(s)
  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi @shimi

    In your case the app on accounts.maindomain.com should integrade Identity Server and login.maindomain.com should connect to accounts.maindomain.com using OpenIdConnect.

    If both apps are AspNet Zero apps, you can enable IdentityServer (for the app accounts.maindomain.com) and OpenIdConnect (for the app login.maindomain.com) in their appsettings.json file.

  • User Avatar
    0
    shimi created

    Hi @ismcagdas Already tried your answer in https://support.aspnetzero.com/QA/Questions/5935

    Configured Identity and OpenId but not working

    Aim is to login from login.domain.com angular project (communicates with api project http://loginapi.domain.com identityserver) after login user is redirected to another subdomain accounts.domain.com angular project (communicates with api project http://accountsapi.domain.com openid) but user can't able to access it.

    identityserver configuration done for loginapi.domain.com

    "IdentityServer": { "IsEnabled": "true", "Authority": "http://loginapi.domain.com/", "ApiName": "default-api", "ApiSecret": "secret",

    openid configuration done for accountsapi.domain.com

    "OpenId": { "IsEnabled": "true", "ClientId": "demo", "Authority": "http://loginapi.domain.com/", "LoginUrl": "http://loginapi.domain.com/api/TokenAuth/Authenticate" }, how can i acheive this? I am new to OpenId connect please help.

  • User Avatar
    0
    ismcagdas created
    Support Team