Autologin to tenant in MT application.
we are implementing Multi-Tenancy in single DB using IMustHaveTenant. We want autologin functionality from our desktop app where we are going to pass tenancy name , username and password to the authenticate method. On success of authenticate method we are launching the webapp URL . The expected result is to start the session and it should redirect to tenant dashboard page instead of login screen.
We are able to call authenticate API and it is returning success also. But after launching the URL , its not starting the session.
Please provide <ins>sample code</ins> for implementing this in your ASP.NET Core/angular 2 framework specifically. This is urgent.
7 Answer(s)
-
0
Do you mean you do a HTTP call in your desktop app, then launch browser and expect the browser to know you're logged in?
-
0
Hi @omkarchoudhari,
This is outside of AspNet Zero's support scope. This is a custom requirement. Because of that we cannot provide a sample code but we can offer you a solution for this.
You can send username, password & tenantcy name in the querystring while opening angular web application. Then, in angular application's startup, just execute the login logic if those query string values exists.
-
0
You can send username, password & tenantcy name in the querystring while opening angular web application. Then, in angular application's startup, just execute the login logic if those query string values exists.
Where is the actual angular startup method located ? I have the method written but do not know where it is to be called ? In which file ? I have tried calling it in TokenAuthController.cs, but it is of no use.
-
0
Hi,
You can do it in AppPreBootstrap.ts. We have used it for similar cases like impersonated and linked account logins, see <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/AppPreBootstrap.ts#L25">https://github.com/aspnetzero/aspnet-ze ... rap.ts#L25</a>.
-
0
the link you mentioned above returns "Page not found !!!!"
-
0
Hi @omkarchoudhari,
Also, if you are not invited on github, you can add your own username here <a class="postlink" href="https://aspnetzero.com/LicenseManagement">https://aspnetzero.com/LicenseManagement</a>.
Thanks.