This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

No 'Access-Control-Allow-Origin' header is present on the requested resource

Comments

4 comments

  • Avatar
    Raya Straus

    Hi Ruth,

    Can you please share with us your code?

    Looking forward to your reply.

    Thanks,

    Raya 

    0
    Comment actions Permalink
  • Avatar
    Brad Smith

    browseFiles.addEventListener('click', () => {
      return axios({
        url: `https://${API_KEY}:${API_SECRET}@api.cloudinary.com/v1_1/${CLOUD_NAME}/resources/image`,
        method: 'GET',
        headers: {
          'Content-Type': 'application/json'
        },
      }).then(res => {
        console.log(res)
      }).catch(function (err) {
        console.log(err);
      });
    })
    0
    Comment actions Permalink
  • Avatar
    Brad Smith

    works all day long from curl on cmd line    

     

    WHERE IS THE DOCUMENTATION on how to format a basic request to list resources? ( the documentation that actually speaks to this error that is:   


    // Response to preflight request doesn't pass access control check:
    // No 'Access-Control-Allow-Origin' header is present on the requested resource.

    )

    0
    Comment actions Permalink
  • Avatar
    Raya Straus

    Hi Brad,

    Thanks for providing us with your implementation.

    Please note that calling the Admin API's resource method is not supported via client side. Moreover, using admin API requires the account's secret key. It should not be used in client code since it leaks that secret.
    The safer alternative would be creating a custom endpoint in your backend which calls Cloudinary's admin API for the resources (so that the secret is not exposed).

    Hope this helps, please let me know if you have any further questions.

     

     

    0
    Comment actions Permalink

Post is closed for comments.