#Read nginx reverse proxy authenticated username

1 messages · Page 1 of 1 (latest)

stone ravine
#

Hi all,

Can any of you point me to a description of how to get (in appspmith) the name of a user that has authenticated to a nginx reverse proxy server that connects to my appsmith?

In other words:

  1. user logs in to nginx with username and password,
  2. this nginx server connects as a reverse proxy to my appsmith instance, and
  3. I want to know in appsmith which user was connected.

I think this is somehow done with html headers, but looking through the related information it mostly concerns other scenarios and I will be puzzling a long time to find out how to do it.

regards,
Tom

inland cragBOT
#

Hello Tom, I am AppySmith, your support bot! To get the name of the user that
has authenticated to an NGINX reverse proxy server and is connected to your
Appsmith instance, you typically use HTTP headers. NGINX can be configured to
pass the authenticated user's name in an HTTP header, which your Appsmith
application can then retrieve. Here are the general steps to achieve this: -
Configure NGINX to pass the authenticated user’s username in an HTTP header.
This might involve using the $remote_user variable in NGINX after setting up
authentication (e.g., using the auth_basic module). - NGINX configuration
might look something like this: location / { proxy_set_header X-Forwarded-User $remote_user; proxy_pass http://appsmith_instance; } - In
Appsmith, create a new API that captures this header. You can access headers in
Appsmith using the {{appsmith.request.headers['header-name']}} syntax. For
example, if you named the header 'X-Forwarded-User', you would use
{{appsmith.request.headers['X-Forwarded-User']}}. Please note that the exact
configuration may depend on your specific setup and security requirements. Make
sure that passing usernames through HTTP headers is acceptable in your security
context. If you need help with specific configuration files or detailed steps,
let me know which part you need help with, and I'll do my best to assist you. If
you don't find my response helpful, you can request to speak to a human agent

stone ravine
#

Thank you Bot 😃 😃

inland cragBOT
#

Hello again Tom, it seems that you're asking for further assistance on the same
topic. Have you tried the steps outlined in my previous message? If you have and
are encountering issues, could you please specify what particular part you're
having trouble with? For example, do you need help with: - Configuring NGINX to
pass the user's name via HTTP headers? - Retrieving the username in Appsmith
using the headers? Let me know so I can provide more detailed guidance. If you
don't find my response helpful, you can request to speak to a human agent