This is more of a design question.
We have web application "webapp" written in Java&Spring which is used by people within our org as well as by people outside. When the user tries to login to the application, it tries to find the user in the local database. If there was a password (encrypted) it will authenticate against that, if password column was empty it will talk to LDAP and authenticate the user. Now we have a new mobile app "mobileapp" that has a link to the "webapp". We are thinking of implementing SSO here so that the mobile app user doesnt have to login again when they click this link. We also think that there will be few more services and applications in the future that have to work closely on same authentication/authorization platform. Couple of things we thought we can do -
- Remove authentication and authorization code from "webapp" and make that a separate service -AA service
- Let AA service generate OAuth tokens and let any client app including webapp use the "Login with AA Service" button to login.
Does this sound like a good solution? Is there a better way to handle this problem? Are there such solutions already built in Java/Spring/Oauth/OpenID connect/JWT etc?