How can I have login page inside my ingress (nginx)? I know I can use basic authentication or OAuth but I want to have a login page just with one user and I don’t want it will be like basic authentication. I want it has a specific page.
How can I have login page inside my ingress (nginx)? I know I can use basic authentication or OAuth but I want to have a login page just with one user and I don’t want it will be like basic authentication. I want it has a specific page.
2
Answers
https://github.com/xavijs/nginx-basic-auth
If I am understanding your question correctly, you’re asking if there’s a way to use http basic auth with a custom HTML form instead of a native browser pop-up dialog.
If that is indeed your question, then yes, you can use XHR (client-side JavaScript) to make a request with the required Authorization: http header. see: https://www.peej.co.uk/articles/http-auth-with-html-forms.html
As per this official NGINX Ingress Controller document, you can create a custom nginx page for OAuth or basic authentication nginx ingress controller. For this you have to use the volume but at the same time if you are using new template then the configmap also needs to be updated.
By using a volume you can add your custom template to nginx deployment like this
For more detailed information on how to use the custom templates refer this document DOC1 DOC2
Try this tutorial for more details (refer to the custom templates section)