I work on the architecture of a distributed system, mainly in ruby โโ(rails, sinatra, etc.).
I have some pure API components, for example API_C1, API_C2, API_C3. It has several web client applications, such as Portal1, Portal2, and some native client applications, such as Native1.
Requirements:
- SSO for all web clients (Portal1, Portal2), centralized authentication.
- All API components must provide their authorization API.
- Centralized API authorization.
I did some POC to try some options, but still don't have a complete picture.
I tried the rubycas server for SSO. It works very well. I believe that if necessary, use the java cas implementation.
Centralized API authorization is pretty complicated for me. I am leaning towards the OAuth2 path, but I have a few questions:
- Is it possible to have a centralized OAuth provider serving all of the API components? How should this work then and which libs / gems to use?
- How can I make my web applications (Portal1 and Portal2) trusted by default. I do not want the user to allow access to trusted applications.
For my own client applications (not a web environment) I want to support 2 OAuth legs. Right choice? Is it possible to have both 3 legs and 2 legs?
How do custom creds convert to oauth token? Assume the following use case:
- the user logs into Portal1 (via the CAS server) and opens the page
- Portal1 server server must retrieve data from API_C1 and API_C2 to show the page. How to enable API here?
I have some thoughts similar to APIs in a single SSO CAS session. This kind of allows me to resolve my scenario 4), there is nothing to code here. But using a session for APIs is bad practice, and how then to mix session and OAuth authorization for the API?
Please point me in the right direction. Could there be some other options to do everything as configured OpenId or OAuth providers to support single sign-on?
x3mka source share