Bug w/ External "SSO" Provider having Multiple Clients #9
Replies: 7 comments
-
Can you please elaborate on why you need this complicated setup? |
Beta Was this translation helpful? Give feedback.
-
Hi, In our actual use case, we have multiple pre-existing web applications each with their own authentication solution and their own storage solution for account / profile information. Each is also managed and maintained by separate groups within our organization. In order to create a better end-user experience we want to create SSO functionality for clients who have access to more than one of our web applications. We came up with the design above as a solution to implement SSO without having to remove or dramatically rewrite each application's auth/storage solutions. The idea being that each application would just need to add our SSO server as an "external provider" and then write a small amount of code to log in the correct user from their own system. If there is a better way to do what we're describing I am all ears but removing all the existing auth systems to create a new unified one is unfortunately not an option at the moment. |
Beta Was this translation helpful? Give feedback.
-
You mention that each web application has its own specific account/profile information. In a scenario where just one identity provider is used that can be maintained. The only thing that needs to be done is to associate the data for each user to the subject id (user id) that is provided by the identity provider. Claims that are relevant to all web applications can then be provided by the identity provider and application specific user data can stay on the level of the web application itself. Is that a possible solution? Having one identity provider per web application defeats the main benefit of using OAuth/OpenID imo. Also: a license will be required for each instance of IdentityServer. |
Beta Was this translation helpful? Give feedback.
-
@TedCorrales Did my comment solve it for you? If so I'd like to close the issue. |
Beta Was this translation helpful? Give feedback.
-
Hi Roland, I might need a little more clarification here. As mentioned above, this SSO design is meant to build on top of multiple existing web applications that each have their own identity provider. We have a few requirements for our solution:
There are certainly different design decisions we would make if we could rebuild this from the ground up, but unfortunately, we don't have that option at the moment. I think what we're trying to do is similar to what you've suggested, but we need to retain the ability for users to login with their existing credentials from the existing identity providers, which is why we decided to try adding this new SSO system as an external provider within those systems (since we can't get rid of them anyway). Regardless, I'm still not clear on why the design provided in our minimal reproduction doesn't work, so maybe some insight into that would help us form a better solution. --Ted |
Beta Was this translation helpful? Give feedback.
-
(note: we're moving this issue to our new community discussions) |
Beta Was this translation helpful? Give feedback.
-
I think the immediate reason that your sample doesn't work is that you haven't set explicit names for the cookies for each of your applications/IdentityServers. When running on localhost, they will simply overwrite each others cookies. You need to set explicit names for the authentication cookie on each client/IdentityServer. I would also like to comment on the architecture. It is (almost never) a good idea to have multiple IdentityServers in parallel or chained as upstreams as you have suggested. It makes the architecture more complex and as each IdentityServer has its own authentication session there are more ways where the sessions can be inconsistent. We would be happy to work with you on the architecture and explore options on how to address your requirements, through our remote consulting services. |
Beta Was this translation helpful? Give feedback.
-
Which version of Duende IdentityServer are you using?
v7.0.0
Which version of .NET are you using?
v8.0.204
Describe the bug
We have a Duende Identity Server License
We have two Web Clients.
Each has its own IdentityServer project based off of "QuickStart 2 - Interactive Applications with AspNet Core".
We have a third IdentityServer project which is meant to server as an external "SSO" Identity Provider.
After using the External SSO Provider to login to one of our Web Clients, attempting to do the same with the other Web Client logs the user out of the SSO External Provider, as well as the first Web Client.
To Reproduce
Expected behavior
Additional context
Our intention is to build a custom SSO solution which will work with a number of pre-existing web applications--each with their own existing 'Auth' project. Within the SSO_Identity_Server UserStore, each user has an associated claim for each web application for which they have access. Each claim contains the UserId of the user within one specific web application's IdentityServer.
Example: Within the SSO_Identity_Server UserStore, the user Bob has claims
When a user attempts to access 1_WebClient, they must login with 1_IdentityServer. We provide a "Custom-SSO" button on this login screen that allows them to login via the external-provider SSO_Identity_Server instead. Behind the scenes, 1_IdentityServer will act as a Client to SSO_Identity_Server.. displaying the SSO_Identity_Server login page to the user. After entering their SSO_Identity_Server credentials, the user is logged in with the external-provider and 1_IdentityServer receives the claim information from SSO_Identity_Server indicating which user from its internal user store should be logged in. Finally, this user should be logged in.
If the user then attempts to access 2_WebClient, we would expect the Custom-SSO button to
Beta Was this translation helpful? Give feedback.
All reactions