Giter VIP home page Giter VIP logo

nginx_oauth_proxy_module's Issues

Simple Same-Origin Requests Fail Due to Origin Check

When making a same origin GET request, the Origin header will not be sent by the client. However, because the module checks for the existence of that header, a 401 response is generated.

e.g. a GET request from a SPA at demo1.example.com/orders to an api endpoint at demo1.example.com/api/v1/orders will fail because the Origin header is not set.

Should the origin check be disabled for non-cors requests?

Unable to Load Module on M1 Mac

Using a docker image of nginx 1.21.3 on a Mac with an M1 chip we are unable to load the module. Error message:

nginx: [emerg] dlopen() "/etc/nginx/modules/ngx_curity_http_oauth_proxy_module.so" failed (/etc/nginx/modules/ngx_curity_http_oauth_proxy_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/nginx.conf:7

The module itself is mounted to the correct location, so I assume it is a dependency that cannot be found.

Tried with amzn, amzn2 and Ubuntu modules. We've also previously tried an Alpine image with the Alpine module, but we've had issues with other Alpine images on M1 before so kind of expected that to fail.

Does the module need to be compiled specifically for machines with the M1 chip?

Header already written warning with error responses

When writing the tutorial I saw this message in logs occasionally, during tests:

header already sent while reading response header from upstream

This occurs when routing to another location within NGINX during tests.
It seems the below add_header call should use default_type instead.

location /api {
        oauth_proxy on;
        oauth_proxy_cookie_name_prefix "example";
        oauth_proxy_encryption_key $ENCRYPTION_KEY;
        oauth_proxy_trusted_web_origin "https://www.example.com";
        oauth_proxy_cors_enabled on;

        proxy_pass http://localhost/mock-api;
    }

    location /mock-api {
        add_header "content-type" "application/json";
        return 200 '{"message": "API was called successfully with an access token"';
    }
}

Browser does not send Origin header for fetch GET

This assumption that all modern browsers send Origin by default is not true.

/* Verify the web origin, which is sent by all modern browsers */

As per MDN documentation of fetch API https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin

Quote:

Broadly speaking, user agents add the Origin request header to:

End Quote

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.