0

Let's say I have multiple Angular/React/Vue applications which I want to enable users to log in once and be able to access all my applications. What I want to solve / ask about is where should I keep my login logic and UI? thanks

Should I create a separate project just to keep all my login logic and UI?

Yes: Redirection and testing will be more complicated if I do that. If I want to test application A on localhost, I have to run SSO project and application A at the same time?

No: However, if I have login logic and UI in each project, there will be a lot of repeated code and ui. It would be hard to modify and maintain.

EDIT - to clarify my questions: Is it good to have a separate project for just login to enable SSO? If it is good, how to make the development and testing process for SSO easier? If it is not recommended, what should I do to reuse the same login code for multiple related projects?

4
  • Sounds like you might want to check out OAuth if you haven't already. As for where to put the stuff, typically it would go in a dedicated authentication server. You could have either centralized or federated identity and credential storage.
    – John Wu
    Commented Jul 24, 2018 at 2:02
  • StackExchange wrote an article on this a while back, trying to find it for you. Details on how they implemented auth across their many sites. Commented Jul 24, 2018 at 9:06
  • This might evolve into arguments pro and con either approach, which in part depends on the size and scope of the project. Some more information about those would be helpful.
    – jwenting
    Commented Jul 24, 2018 at 10:12
  • @JohnWu I am more concerned about front-end project structure, testing and development process. I am using aws cognito.
    – Jun
    Commented Jul 24, 2018 at 10:22

1 Answer 1

2

If there is any natural relations between your projects, then yes - even though it's harder to do. If not there's no real need to it.

Maybe a third party ID service would suit you like Google Facebook? The benefit is that you don't have to store that much user info you do if you build your own.

1
  • I am using aws services and they provide aws cognito.
    – Jun
    Commented Jul 24, 2018 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.