My nginx config file is as follows:
server {
...
location / {
....
auth_request /custom_auth
....
}
location /custom_auth {
proxy_pass http://localhost:9123;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header Host $host;
proxy_set_header X-Original-URI $request_uri;
}
}
Client will provide URL (URL is 3rd party application) and username. URL contains project name. I have a simple file in the same server with project and username mapping. If mapping exists allow the URL to execute, otherwise fail it.
How can I implement this in http://localhost:9123? Using oauth2? when I checked many sample codes, it talks about passwords, tokens, etc., Can this done in a much simpler manner?