[ https://jira.fiware.org/browse/HELP-17542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez reassigned HELP-17542: ------------------------------------- Assignee: Alvaro Alonso > [fiware-stackoverflow] How to access Fiware context behind WILMA PEP proxyavoiding CORS restrictions? > ----------------------------------------------------------------------------------------------------- > > Key: HELP-17542 > URL: https://jira.fiware.org/browse/HELP-17542 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Alvaro Alonso > Labels: cors, docker, fiware, fiware-orion, fiware-wilma > > Created question in FIWARE Q/A platform on 22-03-2021 at 09:03 > {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/66742992/how-to-access-fiware-context-behind-wilma-pep-proxyavoiding-cors-restrictions > +Question:+ > How to access Fiware context behind WILMA PEP proxyavoiding CORS restrictions? > +Description:+ > I am accessing a dockerized orin context broker through a React App. All works fine in the local network but when I deploy to a remote server the request gets blocked by CORS. > i create the request using ngsijs library: > componentDidMount() { > var connection = new NGSI.Connection("http://172.16.2.30:1027", { > headers: { > "X-Auth-Token": token, > "fiware-service": "openiot", > "fiware-servicepath": "/" > } > }); > All works with my local address. > I tried to disable cross scripting protection in wilma context broker in the environment configuration of the docker container : > - PEP_PASSWORD=pep_proxy_bc0e6... > - PEP_PROXY_PDP=idm > - PEP_PROXY_MAGIC_KEY=1234 > - PEP_PROXY_PUBLIC_PATHS=/version > - PEP_PROXY_CORS_ORIGIN=false > - PEP_PROXY_CORS_METHODS=GET,HEAD,PUT,PATCH,POST,DELETE > - PEP_PROXY_CORS_MAX_AGE=true` > The error which I receive is > Access to fetch at 'http://my_public_domain.net:1027/v2/entities? type=SimpleSensor' from origin 'http://87.254.4.166:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request. > The Keyrock IDM works on the exposed domain without any problem allowing identity management. > We are using Apache to redirect the calls to the docker server. -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy