Hi All, I am new to spryker, building a frontend a...
# help
f
Hi All, I am new to spryker, building a frontend application for Spryker B2B marketplace. Here is my Query How can I access Spryker Glue APi endpoints from my frontend application running on different port/server ? The followings are the usecase 1. My frontend React application is running on a different server independently i.e on port 4000 2. My Spryker application is running on Ubuntu environment inside Windows on a 127.00.01 local host. 3. Spryker application is running on a docker container without any ngnix 4. When I tried to call glue APi end point from my react app it responded with CORS error and not able to connect Q-1 How to get access token from the local spryker backend glue APi Q-2 How to fix CORS error for spryker local deployed on a docker container
l
Q-1 You only need the tokens for the private endpoints. You can follow the documentation from here https://docs.spryker.com/docs/scos/dev/glue-api-guides/202108.0/authentication-and-authorization.html#accessing-protected-resources Q-2 You need to add some configuration, for instance in the
config/Shared/config_default.php
you have to add the values that you need to your case:
Copy code
$config[GlueApplicationConstants::GLUE_APPLICATION_CORS_ALLOW_ORIGIN] = 'Your Values';
f
@hallowed-apartment-29399
@nagapsawavankumar