Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Access to API Rest blocked by CORS

Hi!

I want to call the API REST Confluence for my confluence server in Sharepoint's React.js code.

But I have this issue:

Access to XMLHttpRequest at 'http://confluence-server' from origin 'http://sharepoint2019' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I already add http://sharepoint2019 in the whiteliste of my confluence server.

Thanks in advance

1 answer

0 votes

Hello @amasik,

Thank you for reporting this to us. I'm aware of a bug where adding the URL to Allow Incoming in the Confluence whitelist isn't adding the necessary header.

  • CONFSERVER-41269 Access-Control-Allow-Origin header missing from Confluence CORS implementation

There's a workaround on that bug where you can add the header yourself:

  • Add the header via Tomcat by adding the following to <confluence-install>/confluence/WEB-INF/web.xml:

        <!-- Tomcat built in CORS implementation -->
        <filter>
          <filter-name>CorsFilter</filter-name>
          <filter-class&gt;org.apache.catalina.filters.CorsFilter</filter-class&gt;
        </filter>
        <filter-mapping>
          <filter-name>CorsFilter</filter-name>
          <url-pattern>/*</url-pattern>
        </filter-mapping>
        <!-- End of built in CORS implementation -->
    
  • If using Apache as a reverse proxy, add the following to the <Location> or <VirtualHost> configured for Confluence (reference: CORS on Apache):
    Header set Access-Control-Allow-Origin "*"


Can you try that, and let me know how it goes?

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

415 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you