Im building an app with Dwolla that has a backend server written in NodeJS and a frontend client written in ReactJS. I’ve been trying to work with the Drop in components but I have a problem with the component not managing to go past the server side CORS policy.
nothing works, it keep getting blocked with different messages. For the setup I have above in the express script the error Im getting is: Access to fetch at ‘http://localhost:5000/dwolla/token-url’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’ when the request’s credentials mode is ‘include’.
Would really appreciate the help - I should not this is not happening with any other calls, from postman, client, curl etc.
Same problem here. We have set our “Access-Control-Allow-Origin” to our localhost for our frontend correctly and are seeing the CORS issue complaining about this as above.
Could you help? We would like to use the tokenUrl instead of the token parameter on our front end components.
Thanks.
kmoreira
(Kelly M. - Developer Advocate @ Dwolla)
4
Kelly, thanks. We do see the access control error when we tried using tokenUrl which is why we were attempting to use the token paramter.
Besides setting the “Access-Control-Allow-Origin” correctly on our response to not be *, what else do we need to do? It seems setting it to our front end url (which is localhost:3000) still doesn’t work.
Just to be clear we get "Response to preflight request doesn’t pass access control check: The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘’ when the request’s credentials mode is ‘include’.*
Hi @Saveraa_LLC – Your Client token token call looks alright! It does look like the issue is with the frontend not being able to create calls to your backend code.
I wonder if you’re still receiving the CORS error even when using your frontend url because your domain and port doesn’t match exactly in the Access-Control-Allow-Origin header? I found the following resources online which might be helpful to reference