I want to log in to WordPress dashboard with http X-User header provided by reverse proxy server.
I'm planning to use WordPress as a CMS where our organization members can freely write articles. To maximize user experience, I want to allow users to login to the dashboard with our organization account. Our servers are constructed on Docker containers behind one nginx reverse proxy server container, which checks the request by questioning to the authentication server, and notify the application server by adding X-User header.
Here's my nginx.conf
location /_login {
internal;
proxy_pass http://auth-server/path/to/api;
}
location @unauthorized {
internal;
return 302 http://auth-client.example.com/path/to/login-form
}
location / {
auth_request /_login;
auth_request_set $user $upstream_http_x_user;
proxy_set_header X-User $user;
proxy_pass http://wordpress/;
error_page 403 @unauthorized;
}
Is there any appropriate plugin to do that? Or I have to create a new plugin?