{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by Mathanprasath k · Aug 20, 2018 at 05:04 PM · 60 Views apigee edgeapi proxyapigeeapisapi

Which policy to be used to send the generated access token (client_credentials) back to consumer?

I have a Raise Fault policy in the flow which currently sends the generated access token back to the consumer of my API but what is the problem with this approach is when I go to Analytics->Proxy performance and select the OAuth API Proxy, it shows 100% Traffic Errors although the OAuth API successfully generated the access token in all the cases.

I strongly believe this is because I used Raise Fault policy hence internally Analytics considers it's a error flow hence Analytics data logged accordingly for all the success cases.

If some one would ask me to use Assign Message Policy instead of raise Fault then I can't because in my flow I've many other policies attached after Raise Fault policy which currently sends back access token to consumer.

Appreciate your response.

Many thanks!

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
1
Best Answer

Answer by Dino-at-Google   · Aug 20, 2018 at 05:58 PM

Don't use RaiseFault to send back success messages.

You are correct that your use of RaiseFault is causing the analytics to show 100% errors.

you wrote

If some one would ask me to use Assign Message Policy instead of raise Fault then I can't because in my flow I've many other policies attached after Raise Fault policy which currently sends back access token to consumer.

I don't agree. Use AssignMessage., or use the implicitly-assigned value that you get from OAuthV2-GenerateAccessToken. You say "I can't" but I suspect the reason you cannot use the correct approach is because you have co-opted the FaultRules elements to handle normal flow. This is wrong. This is why your analytics are incorrect. Don't use the RaiseFault policy for successful flows.

Your flow can look like this:

<Request>
  ...
</Request>
<Response>
  <Step>
    <Name>OAuthV2-GenerateAccessToken</Name>
    <!-- response.content gets assigned --> 
  </Step>


  <Step>
    <!-- modify response.content as desired -->
    <Name>JS-GroomTokenResponse</Name>
  </Step>


  <Step>
    <Name>Other-policy-here</Name>
  </Step>
  
  ...
  
</Response>

Don't use RaiseFault.

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mathanprasath k · Aug 21, 2018 at 08:49 AM 0
Link

Thank you @Dino-at-Google . I will try your suggested approach. Appreciate it.

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to deploy multiple proxy End points in one proxy? 1 Answer

How to validate SAML Issuer provided in request? 2 Answers

calling service call in fire and forget pattern 2 Answers

How the get only one specific response in apigee? 1 Answer

unable to generate jwt 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges