We are currently implementing SSO within our organization, have have settled on using OpenId Connect for our authentication protocol (specifically using Gluu).
The problem we are running into is passing an identity, that we can prove has been authenticated, to a chain of backend services. I've seen people pass the id_token, but from what I understand that really isn't the intent of the id_token, but instead is only really meant for the initial client to consume.
Lets say we have an Angular Application calling a related REST service, which them call some sort of data service. Currently, the angular app will re-direct an unauthenticated user to Gluu for login, and provides the id_token and an access_token.
Gluu's implementation is to provide an opaque access_token. So when we pass that token from the Angular application to the REST service, we go back to Gluu to validate the token, pull user info associated with it (based on the scopes that were used with OpenId) and client info. This all works fine with the first hop.
The problem comes when connecting from the REST service to the data service. Using the client_credential flow, the REST service calls Gluu with the scope for the data service to get a new access token. However, I have found no way to exchange the original token, for a new token which preserves the original user claims.
I've seen advice where people say, "well you're within a trusted domain, so just pass the userid and trust that they have been authenticated." This will not work for us. We were using a HMAC scheme previously, and teams were passing around userids that had never been authenticated, impersonating users without their knowledge, which is why we need a way to ensure that the user has been authenticated.
I feel like I'm missing a piece of the puzzle here. What is the "right" way to do this?