Skip to content

Proxy server not able to authenticate using cookies #415

Closed
@RonB

Description

@RonB

I am using a proxy to redirect calls during development to our application server.

I need to login using a login form submit and a returned cookie to be sent on every next request to the server.

I had to adjust the serve.js file and add

opts.rejectUnauthorized = !(proxy.rejectUnauthorized === false); // create setting in ionic.project
opts.cookieRewrite = proxy.proxyUrl; // my application server needing authentication

for every proxy specified otherwise the cookie is not set in the browser and thus not redirected thru the proxy. The ionic.project configuration:

"proxies": [
    {
      "path": "/api",
      "proxyUrl": "https://app.ontwikkeling.webbergen.local/api",
      "rejectUnauthorized": false
    }
]

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