Base solution for your next web application
Open Closed

One login Multple ASP.NET Boilerplate Apps #1807


User avatar
0
mcmaestro created

Hello all,

We are developing multiple applications that are use the boilerplate but I would like for the user to be able to have one login and be able to login or use a service from a different applications.

Kind of like google login process for it's services.

Any help would be great!

Thanks,


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can use token based authentication for your other apps. See <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide#token-based-authentication">https://aspnetzero.com/Documents/Develo ... entication</a>

  • User Avatar
    0
    mcmaestro created

    <cite>ismcagdas: </cite> Hi,

    You can use token based authentication for your other apps. See <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide#token-based-authentication">https://aspnetzero.com/Documents/Develo ... entication</a>

    I could but I still would need to have the user's account automatically set up in the other application if it does not exists. I read some articles on stackoverflow about how they handle this issues so I am going to try to follow up on that.

    Thanks for your help.

  • User Avatar
    0
    hikalkan created
    Support Team

    You want a kind of single sign on...

    You can 2 options;

    1. You can use a sign in server like identity server (<a class="postlink" href="http://identityserver.io/">http://identityserver.io/</a>). While it's a bit hard to learn and use, it's very powerful.

    2. Create your own solution. to do that;

    a. Think one of the apps as the 'default/main' app. b. For other apps, redirect user to this default application to login. If user is not logged in yet, he can login via a user/pass form. If he is already logged in to the default app, then no need to re-enter user/pass. c. Default app stores user informations (name, username, email and others) in a temporary place (a redis cache or a shared db) with a random token for a limited time (say 1 minute). d. Default app then redirects user to the other app again and passes this token as query string args. e. Other app gets token, access to the temporary cache, gets user informations and login the user (and it also can create user in it's own db if needed).

    Have a nice day.

  • User Avatar
    0
    mcmaestro created

    Thanks @hikalkan and everyone else help on this.

    I have decided the second option that you mentioned is good and I have made some great progress but I have ran into another issue. Locally when I have the two application running and I try to login to the second app. After the first app redirects back to the second app. The AbpSession information from the first app is referenced in the Second app which causes an error. How is that possible? When I go directly to the second app the page loads the data correctly. Is the Clams Identity unique per application or is that information shared?