Consume oauth(password grant type) protected backend API via APIGEE

Not applicable

Hi,

I need to consume a OAuth protected a backend API from my APIGEE proxy. My backend API is protected with password grant type.

My API proxy consumers won't pass any token. I need to get the token by calling backend target and I need to pass token in each request to backend.

Is it possible to fetch token and adding token in APIGEE proxy ?

0 2 265
2 REPLIES 2

Hi @Gopi Krishna M

Please see this recent post -- It think it addresses your question about how to reuse a token generated by an auth service that is external to Edge. Let us know if you need additional pointers. Please refer to the Edge docs for information on the policies mentioned including cache, assign message, etc. Also, there's a good topic on fault handling in the Edge docs. Also here's a Learn Edge example that shows you how to trap an error from an external service, raise a fault rule, and return a custom message back to the client.

Will

Hi @wwitman,

Thanks for answer, am able to cache access-token.

One more question, i want to hit my target server again for token if it gives error saying "access-token expired". How we will implement this one?