Skip to content

CORS policy not being bypassed #525

@bmp02050

Description

@bmp02050

I am trying to write an connector that requires a user to send in a ClientID and Secret through OAuth2 as client_credentials in order to get an access token. I can successfully use the "post" connector method to retrieve the data, however, when I go to create a request to our API, I get 405 errors and CORS exceptions, even though I am passing the request options to bypass CORS policy.

return new Promise(function (resolve, reject) {
let requestOptions = {
bypassCorsPolicy: true,
headers: {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json'
}
};
let endpoint = "API Path";
let requestBody = {};

    post(endpoint, requestBody, requestOptions)
        .then(data => {
            console.log('Get Groups successful!');
            console.log(data); // Process the response data
        })
        .catch(error => {
            console.error('Error:', error);
        });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions