-
Notifications
You must be signed in to change notification settings - Fork 3k
Add the ability to secure proxy hosts with OpenID Connect #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Docker Image for build 2 is available on DockerHub as |
Docker Image for build 3 is available on DockerHub as |
cb86529
to
956e1b7
Compare
Docker Image for build 6 is available on DockerHub as |
Docker Image for build 7 is available on DockerHub as |
I've pulled the image and tried it out. The first thing is that I can't save the proxy host when I filled out the open ID stuff. I did not enable the emails section, when I try to save the console tells me it's trying to focus a input that is not visible. When I then enable the emails, and then disable them, I can save. Seems like the emails are form-required without being shown. The second thing is, and keep in mind I know a bit about oauth, the settings can be a little confusing. I've referred to your notes here in this PR to set something up with Auth0 so it might be worth adding a link to the online documentation later (after this PR). Apart from that I was able to successfully set up Auth0 as a OpenID service :) Just need to fix the form saving and that's it |
There is a Knex issue ( knex/knex#2649 ) that prevents .defaultTo from working for text columns.
… enabling/disabling oidc. If this is not triggered and the OIDC toggle is enabled, the "disabled" property will be removed from the restricted user list input, causing an error when trying to submit the form without it.
Docker Image for build 9 is available on DockerHub as |
@Ducky710 nginx is pretty aggressive with the frontend caching, try clearing it before accessing the admin interface |
I was indeed referring to the browser cache. I'm not sure why it doesn't show up for you if you've already cleared it, could you join the Gitter chat so we can troubleshoot better? https://gitter.im/nginx-proxy-manager/community |
Docker Image for build 10 is available on DockerHub as |
First, awesome feature. I am currently in the process of rolling out my SSO.... But I´m experiencing a problem when logging in. It works just fine on Chrome, but on Safari I get " I'm using Keycloak and its works fine on Jira(SAML), Confluence(SAML), Seafile(OpenID) etc. Any Ideas? |
@jc21 Any plans to merge this into master? |
Hi how can i install it with docker-compose? Thank you very much |
+1 on the previous post from @Secarius it is also unclear to me |
@NopeNix and @Secarius If you just want to know image name to use in docker compose: jc21/nginx-proxy-manager:github-openidc |
Any chance on getting this mainlined? |
Would also like to see this get mainlined. |
i dont know what you mean with B2C but it is generally possible to use Azure OIDC. i tested it about 2 month ago. make sure you are using the OpenIDC Branch of the project so you have the menu point for Open ID Connect in the interface. Good Luck! |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Does this mean NPM is able to use/work with a tool like Pocket-id? |
What is this?
This PR implements OpenID Connect authentication for proxy hosts using the lua-resty-openidc library, now that NPM uses OpenResty instead of vanilla nginx.
What is OpenID Connect?
OpenID Connect is an identity layer on top of OAuth2 that lets you do Single-Sign-On (SSO) using an identity provider (IdP) like Azure AD or KeyCloak.
How does this benefit me as an NPM user?
You will now be able to restrict access to your proxy hosts only to users who can successfully authenticate with the IdP. For example, only allow users in your Azure Active Directory to access your
internal-tool.example.com
subdomain.Work in progress
I would like to ask for some help with the UI layout, it currently looks kind of out of place (screenshots below).
Future improvements
These are things that could be improved upon but will probably be added in a separate PR.
openid email profile
.id_token
claims to pass to the backend application, or maybe simply forward the entireid_token
.client_secret_post
andclient_secret_basic
.Related issues
How to use it
You will need a few things to get started with OpenID Connect:
A registered application with your identity provider, they will provide you with a
Client ID
and aClient Secret
. Public OpenID Connect applications (without a client secret) are not yet supported.A redirect URL to send the users to after they login with the identity provider, this can be any unused URL under the proxy host, like
https://<proxy host url>/private/callback
, the server will take care of capturing that URL and redirecting you to the proxy host root. You will need to add this URL to the list of allowed redirect URLs for the application you registered with your identity provider.The well-known discovery endpoint of the identity provider you want to use, this is an URL usually with the form
https://<provider URL>/.well-known/openid-configuration
.After you have all this you can proceed to configure the proxy host with OpenID Connect authentication.
You can also add some rudimentary access control through a list of allowed emails in case your identity provider doesn't let you do that, if this option is enabled, any email not on that list will be denied access to the proxied host.
The proxy adds some headers based on the authentication result from the identity provider:
X-OIDC-SUB
: The subject identifier, according to the OpenID Coonect spec:A locally unique and never reassigned identifier within the Issuer for the End-User
.X-OIDC-EMAIL
: The email of the user that logged in, as specified in theid_token
returned from the identity provider. The same value that will be checked for the email whitelist.X-OIDC-NAME
: The user's name claim from theid_token
, please note that not all id tokens necessarily contain this claim.Screenshots