API / APIGEE Gateway Interview Questions
How does OAuth 2.0 work in Apigee and what grant types are supported?
Apigee implements the complete OAuth 2.0 specification via the OAuthV2 policy. Apigee can act as an authorisation server (issuing tokens) or as a resource server (validating tokens), or both. All four OAuth 2.0 grant types are supported.
| Grant type | Use case | Flow summary |
|---|---|---|
| client_credentials | Machine-to-machine; no user involved | App sends client_id + client_secret; Apigee returns access token |
| password (Resource Owner Password) | Trusted first-party apps | User sends username + password; Apigee validates + returns token |
| authorization_code | Third-party apps; user consent required | Redirect flow; user authenticates at IdP; code exchanged for token |
| implicit | Single-page apps (legacy; less secure) | Token returned directly in URL fragment; no backend code exchange |
<!-- Step 1: GenerateAccessToken policy (Apigee acts as auth server) --> <OAuthV2 name="GenerateToken"> <Operation>GenerateAccessToken</Operation> <ExpiresIn>3600000</ExpiresIn> <!-- 1 hour in milliseconds --> <SupportedGrantTypes> <GrantType>client_credentials</GrantType> </SupportedGrantTypes> <GenerateResponse enabled="true"/> </OAuthV2> <!-- Step 2: VerifyAccessToken policy (protect API proxies) --> <OAuthV2 name="VerifyToken"> <Operation>VerifyAccessToken</Operation> </OAuthV2> <!-- Client credentials token request: POST /oauth/token Authorization: Basic base64(client_id:client_secret) Content-Type: application/x-www-form-urlencoded grant_type=client_credentials Response: { "access_token": "eyJ...", "token_type": "BearerToken", "expires_in": "3599" } -->
When acting as a resource server only (validating tokens issued by an external IdP), Apigee validates the token's signature and expiry using the VerifyAccessToken operation, optionally checking scopes and audience claims.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
