.Net - Share token between two webapi on same IIS
.Net - Share token between two webapi on same IIS
I have a project based on Angular2 for FrontEnd and a .Net WebApi 2.0 for the backend.
Now I have to implement a parallel project that has to use the same Authentication.
What I want to do in my mind is create a new webapi 2.0 and share the token between the two webapi in order to avoid the user to provide the same user and password if he switch between projects.
Is it possible ?
The other solution is use the same Webapi for project2 and extend the controllers/methods, but I want to create a new project for it.
Thanks to support
1 Answer
1
Well, if application is hosted in 2 different environment it will be treated as 2 different applications, however Load Balancer was introduced to handle multiple environments.
With respect to .net :
Out Proc session is the one you should be looking for, both the web application need a common layer to save token, it can be DB, Shared File, etc., but has to be common layer.
Other approach I can go with to generate a Same token everytime when particular set of parameter is passed to it
With both approach, you have to make a 1 common layer.
You mentioned Same User and Password, so if 1 user comes in you will navigate to either of the hosted application, that what I said a common layer that can be any algo, DB, file, even a different web service where you can send userid password and generate a token
– Nipun Ambastha
Jun 29 at 8:50
I already have a database where I implement .net Identity, I just have to share token between the apps
– DarioN1
Jun 29 at 9:20
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
The environment is the same, also the domain is the same... Its just 2 similar application on the same IIS... What about to manage the MachineKey in webconfig ?
– DarioN1
Jun 29 at 8:47