{ 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 /
  • Developer Portal (Drupal-based) /
avatar image
0
Question by Shivakumar Sudi · Feb 26 at 11:37 AM · 103 Views cors

CORS not working for Access Token Expired error

Hi,

I have a CORS enabled proxy and it works fine for all the scenarios including the negative scenarios. . However, if the token is expired and apigee throws token expired error, it doesn't work. I get

isTrusted": true error on portal. can someone help? I should get the proper error for token expired error as well.

Comment
Add comment Show 1
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 Siddharth Barahalikar   · Feb 26 at 01:15 PM 0
Link

Hi Shivakumar, can you update your question with the details of the CORS policy you have used and the screenshot of F12 Developer Tools Console error when you are getting isTrusted": true error on the portal.

Close

1 Answer

  • Sort: 
avatar image
1
Best Answer

Answer by Nagashree B   · Feb 26 at 06:19 PM

@Shivakumar Sudi

It appears you do not have the CORS headers included for error scenarios. Can you post your trace and the error from the console on the browser.

When an API proxy encounters an error, regardless of how it occurs, it exits the normal flow pipeline, enters an error state, and returns an error message to the client app. Once the API proxy enters the error state, it cannot return processing back to the normal flow pipeline.

So if you defined the Assign message policy to Add the CORS headers in the Respone flow, it will not get executed due to the token expired error. Try defining a default fault rule, with AlwaysEnforce set to true, with an Assign Message policy to include the CORS headers for all error scenarios

<DefaultFaultRulename="fault-rule">
<Step>
<Name>Add-CORS-Headers</Name>
</Step>
<AlwaysEnforce>true</AlwaysEnforce>
</DefaultFaultRule>
Comment
Add comment Show 2 · 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 Shivakumar Sudi · Feb 27 at 09:56 AM 0
Link

@Nagashree B thank you. Added the below step and it works fine now.

<DefaultFaultRule name="fault-rule">
<Step>
<Name>add-cors</Name>
</Step>
<AlwaysEnforce>false</AlwaysEnforce>
</DefaultFaultRule>

avatar image Nagashree B Shivakumar Sudi   · Feb 27 at 08:23 PM 0
Link

@Shivakumar Sudi

Glad it worked, you can accept the answer if it helped you.

Follow this Question

Answers Answers and Comments

70 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

Related Questions

Mixed Content error when loading documentation 1 Answer

Create new API Proxy with Node and CORS 3 Answers

CORS Issue Calling API from New Edge Dev Portal 0 Answers

CORS issue with new Bootstrap (Beta) Portal 2 Answers

Swagger UI showing no response in developer portal even after adding CORS header 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