Using apigee with an external custom STS

Not applicable

We have an in-house security token service (working with standard OpenId Connect/OAuth 2.0) federated with several different IdPs that manages the security of all our web apps and APIs. It emits user access tokens with custom metadata and most of our backend's security is based on that custom metadata. At the moment, all the security applications (client ids, secrets) defined in the STS are simply stored in a XML file deployed with it. It's not ideal, but it's simple and since it's only managing our internal applications, it's been working just fine so far.


We are at a point now where we'd like to give access to our APIs to external customers and we need a platform to manage subscriptions/licences to our APIs and provide a developper portal to our custsomers. The problem we have is that we can't stop using our STS because most of our APIs rely on our custom user tokens to work. We don't want to change that, as it would be very expensive to change course now and it has allowed us to greatly improve the performance of our backend over the last few months.


What we would like to do, is use Apigee to manage our customers' secucrity applications, and access all its data (client ids, secrets, redirect uris, etc.) through APIs during runtime with our STS to allow us to use Apigee's data as a second security application store. This way, we'd still be able to use our custom tokens, we'd get an application management module (UI) for our customers without having to build one ourselves, and we would still be able to use Apigee's features to manage subscriptions/licences and access rights to our APIs based on access tokens instead of API keys (as API keys would force our customers to "wrap" our APIs to secure the key, instead of just building javascript single page apps). Is that scenario possible?

2 3 445
3 REPLIES 3

Hi Carl,

With Apigee Edge acting as the authorization server for API resource access, authorization to all API products is tied to the API Key on Edge. However, this doesn't mean that the client app needs to provide the API Key in it's requests, for Edge to validate API Product access. As you had stated, the client can send an OAuth token instead to the API resources, however that token needs to have been generated with an API Key that Edge can recognize, in order for it to associate the access token to an API Product.

This doesn't mean that you can't use the method stated in your scenario. You can still use that method, provided you import the client IDs from your existing system into Edge as API Keys. You can do this using this management API on Edge: https://docs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_em...

Once Edge is able to recognize the API Keys, and those keys are associated to Apps and API Products on Edge, you can use OAuth token endpoint proxies deployed on Edge, which can be configured to talk to your STS when generating tokens.

For more information on the scenario, please refer: https://docs.apigee.com/api-services/content/use-third-party-oauth-system

- Vidya

Not applicable

Hi Vidya,

Is there an api to retrieve all client id (API Key), client secret, oauth callback uri, scopes and maybe some custom attributes from clients applications in Edge? Is it also possible to provide an URI as JWKs source in the Verify JWT security policy?

Alain

Hi Alain,

Yes, the management API is documented here: https://docs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/developers/%7Bdeveloper_ema...

Regarding the source of the JWT in the incoming request, regardless of where the JWT needs to be picked up in the incoming request object, Apigee provides context variables to reference the value in the Verify JWT policy. For a reference of all context variables available, see: https://docs.apigee.com/api-services/reference/variables-reference

Hope this helped!

- Vidya