Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS policy not being bypassed #525

Open
bmp02050 opened this issue May 31, 2023 · 0 comments
Open

CORS policy not being bypassed #525

bmp02050 opened this issue May 31, 2023 · 0 comments

Comments

@bmp02050
Copy link

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);
        });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant