Our project consists several sub application, and we are looking for a solution to implement SSO to avoid the authentication for each sub application.
Suppose this is the structure of our project:
authentication server(call it AS or IdP or something else)
order-system
product-system
data-analysis-system
.......
And we found that there are a lot of articles of "SSO implemented based on OAuth2" like this.
In that article, we prefer to the SAML strategy because it is simple and clear, however there are some limitations for native application, then we focused on the OAuth2.
This is the work flow:
1 Rules in OAuth2
Resource Server (SP) – this is the web-server you are trying to access information on.
Client – this is how the user is interacting with the Resource Server. This could be a browser-based web app, a native mobile app, a desktop app, a server-side app.
Authorization Server (Idp) – this is the server that owns the user identities and credentials. It's who the user actually authenticates and authorizes with.
Take OctoDroid as an example, the rules are very clear:
Client: OctoDroid
Idp: GitHub
SP: Github
User: one who use OctoDroid application.
The workflow is that OctoDroid(Client) ask you(User) to login and grant permissions through Github(Idp) to get the resources(repos,issues) from Github(SP).
But in our application, what exactly can each sub-system treated? a SP or a Client ?
If treated as a SP, is web browser the Client? I always thought that a Client should be an application. Also the sub-system validate the access_token through Idp for each request and then return the related resource, will this increase the pressure to the Idp?
If treated as a Client, who is the SP?
2 Rules in application
For a same user, he may have different rules in different sub-systems, for example, he can read/write all the orders from order-system, but he can not access the product-system. Then where should the rules configuration happen? In the Idp or in each sub-system?
3 Session Synchronization
For a typical SSO system, when user login(through Idp), all sub-system should login, when user logout , all sub-system should logout.
However in the above OAuth2 workflow, it seems that different SPs or Clients are independent. When you logout from OctoDroid, you can still use OpenHub once you have login. In this case, it seems like OAuth2 is different from SSO, how can they work together?
4 Idp connect to another Idp
In our application, In addition to the basic username and password login, the authentication server should provide login from google,facebook and other CAS providers too. Is this possible?
BTW, I am not sure if I have made myself clear enough, if not, ask me in the comments.

