That is okay, consider first application passes token to second application in querystring, the first problem is we can access query string in constructor of login page, before that GetAll() and GetCurrentLoginInformations function will call so only chance is to reload login page again with new cooke value in second app. The question is "Is there any way to access token query string before it reaches constructor of that particular component"
That is okay I am receving token in second app also but where to receive the token in login page or in some other service so that it canot promp user to login again
Ok, but how can I pass and receive token in two aspnetzero application?
Hi @ismcagdas
Is there any other settings by which I can communicate authentication between subdomains?
@Hi @ismcagdas,
There is no login for accounts.domain.com any users with out authentication must be redirected to login.domain.com. And if authenticated user can access accounts.domain.com.
My objective is very simple user logs in from login.domain.com if authenticated he can access subdomains like accounts.domain.com and hr.domain.com etc with out asking relogin. And if user is not logged in and types accounts.domain.com he will be redirected to login.domain.com
In MVC Application we can use cookies and can set machine key in iis for this purpose. But here the problem is UI is in angular and service is Webapi for all applications.
Is there any setting want to be enabled in Angular login application or in Angular Accounts application?
Hi @ismcagdas
no error is there. Are my configurations correct? when i logged in from login.domain.com and reached accounts.domain.com it again asks authentication. Please put the configurations example for both domain and is there any settings needed in angular application for both domains?
Application 1 (webapi and angular login project) Application 2 (webapi and angular accounts project)
@ismcagdas
yes both are AspNet Zero apps
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.