Skip to content

Merging oidc branch with develop #1388

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

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Merging oidc branch with develop #1388

wants to merge 13 commits into from

Conversation

jc21
Copy link
Member

@jc21 jc21 commented Sep 8, 2021

See discussion on #753

See this doc for instructions.

NOTE: For anyone wanting to test this patch, back up your entire NginxProxyManager config and database first. You won't be able to jump back to the latest tag afterwards as this PR will run a database migration.

@jc21 jc21 added the requires-verification Waiting for one or more people to confirm the fix label Sep 8, 2021
@jc21
Copy link
Member Author

jc21 commented Sep 8, 2021

This is an automated message from CI:

Docker Image for build 1 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-1388

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@noelhibbard
Copy link

I just updated my docker-compose to use jc21/nginx-proxy-manager:github-pr-1388 and I don't see a new "OpenID Connect" tab. I'm looking at your commits and I see where you added a tab, I'm just not seeing it. I must be missing something.

@notchrissss
Copy link

notchrissss commented Sep 30, 2021

Looks like it breaks the "New Proxy" button on Edge (my fault for using Edge, but strange as it does still work in Chrome).
edit: adding proxies breaks in this image.
image

@notchrissss
Copy link

I just updated my docker-compose to use jc21/nginx-proxy-manager:github-pr-1388 and I don't see a new "OpenID Connect" tab. I'm looking at your commits and I see where you added a tab, I'm just not seeing it. I must be missing something.

You could try doing a CTRL+F5, your browser could be caching the dashboard but it's unlikely.

@noelhibbard
Copy link

I just updated my docker-compose to use jc21/nginx-proxy-manager:github-pr-1388 and I don't see a new "OpenID Connect" tab. I'm looking at your commits and I see where you added a tab, I'm just not seeing it. I must be missing something.

You could try doing a CTRL+F5, your browser could be caching the dashboard but it's unlikely.

Ctrl+F5 was the first thing I tried. I believe I was editing an existing host though. Maybe this tab only shows up when creating a "new" host. I already rolled back to my previous docker image so I can't easily check.

@jakefrancois5
Copy link

jakefrancois5 commented Oct 2, 2021

Looks like it breaks the "New Proxy" button on Edge (my fault for using Edge, but strange as it does still work in Chrome). edit: adding proxies breaks in this image. image

Same error in chromium & firefox. Appears to be an issue with openid connect mandatory fields still being required trying to create a new proxy host without filling in the open id connect tab.. However if I create a new host using open id connect, it works.

Error:
[10/2/2021] [3:24:18 PM] [Express ] › ⚠ warning insert into proxy_host (access_list_id, advanced_config, allow_websocket_upgrade, block_exploits, caching_enabled, certificate_id, created_on, domain_names, forward_host, forward_port, forward_scheme, hsts_enabled, hsts_subdomains, http2_support, locations, meta, modified_on, openidc_allowed_users, openidc_auth_method, openidc_enabled, openidc_restrict_users_enabled, owner_user_id, ssl_forced) values (0, '', false, true, false, 0, NOW(), '["something.com"]', '192.168.10.40', 7878, 'http', false, false, false, '[]', '{"letsencrypt_agree":false,"dns_challenge":false}', NOW(), '[]', 'client_secret_post', false, false, 1, false) - ER_NO_DEFAULT_FOR_FIELD: Field 'openidc_redirect_uri' doesn't have a default value

@notchrissss
Copy link

notchrissss commented Oct 3, 2021 via email

@@ -51,7 +51,8 @@ proxy_http_version 1.1;

{% endif %}

{% include "_hsts.conf" %}
{% include "_openid_connect.conf" %}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently additional locations are not protected behind oidc. Would adding this line to /backend/templates/_location.conf be sufficient?

Maybe this should be behind a toggle so that opt-in or opt-out is possible per location?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A workaround for anyone else that need this is to copy the generated oidc config into the advanced section of the locations.

In my case I copied it to a file in the custom folder and imported that in the locations that need it. This also make it easier to share the same oidc setup for multiple proxy hosts, but that isn't as big of a deal for me.

@ForceConstant
Copy link

Any updates on this? Would love to get support for Keycloak in master.

@jakefrancois5
Copy link

jakefrancois5 commented Mar 9, 2022

I've identified the cause of the issue. The default values of '' for the new 'text' type mariadb columns such as 'openidc_redirect_uri' are not actually being set despite the knex code migrations telling it to.

Manually connecting to the database and executing the following SQL command for each text column related to openidc fixes the issue:

ALTER TABLE npm.proxy_host MODIFY COLUMN openidc_client_secret text CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' NOT NULL;

Reasonable solutions/workarounds for this would be:

  1. Allow null values on these columns
  2. Try using the string type (varchar) instead of text and see if that works (would be limited to 255 characters)
  3. (Below)

Not tested, but I'm thinking that adding the following code for each column in backend/models/proxy_host.js may fix the issue as well:

// Set defaults for blank text columns
		if (typeof this.openidc_redirect_uri=== 'undefined') {
			this.openidc_redirect_uri= '';
		}

Found this issue for Knex that would appear to be the root cause:
knex/knex#2649

@natereprogle
Copy link

I'd love to see this pushed to main as well. However, when I tried to pull the github-pr-1388 build I had the same issue @noelhibbard did, in which the OpenID tab would not appear. Official support for OpenID would be very nice compared to the Access Lists that already exist (Which have issues of their own)

@clemans
Copy link

clemans commented Apr 9, 2022

Any updates? Really want this feature merged into main! Recently revamping a project that absolutely need OIDC support and as a recent supporter of NPM would hate to have to switch to Traefik.

@mattchewey
Copy link

Adding my vote that this would be very beneficial. Hope this can get merged soon.

@JeWe37
Copy link

JeWe37 commented Dec 3, 2022

Is there some means of helping out with this so it can get merged? Any way to be useful for verification?

@JeWe37
Copy link

JeWe37 commented Dec 9, 2022

To give perhaps a few more datapoints: I gave this a shot myself, rebasing to develop was easy enough, and to me at least it seems to work just fine. I also haven't been having any of the issues mentioned above on firefox. In so far as i understand it what is described regarding the database was already fixed in 9f2d3a1 . Are there any blockers to merging this officially? For the time being now that i figured out how to build this I can keep on using my version.

For reference: I use Keycloak as my OIDC provider and have had no issues just setting it up the standard way.

@validide
Copy link

validide commented Feb 13, 2023

First of all I would like to say I really like the project.

I am wondering what is the state of this merge request or it there is any way of assisting with it.

@Kurnihil
Copy link

I've "rebase" the openidc branch to develop, you can find it here:
https://github.com/Kurnihil/nginx-proxy-manager/tree/oidc

i've setup without problems keycloack to protect phpmyadmin login page...

if something more is needed to merge it into develop let me know!

@Hadatko
Copy link
Contributor

Hadatko commented Aug 18, 2023

+1

@tezgno
Copy link

tezgno commented Nov 26, 2023

@Kurnihil, how can I pull your version to test on my end?

EDIT:

I forked the repo and added the changes. Going to do some testing over the next few days.

@skutter-de
Copy link

What is the current status here?

@zzzz0317
Copy link

I noticed that this branch in the project hasn't been merged into the master for three years. I'm interested in this feature and willing to help. Could anybody tell me its status and what I can do to assist?

@DFS-90
Copy link
Contributor

DFS-90 commented Aug 5, 2024

I've "rebase" the openidc branch to develop, you can find it here: https://github.com/Kurnihil/nginx-proxy-manager/tree/oidc

i've setup without problems keycloack to protect phpmyadmin login page...

if something more is needed to merge it into develop let me know!

@Kurnihil :
Thanks for your efforts!

I wanted to test oidc, but I never built docker images on my own before.
The steps I took (trial and error) to get this ready:

  • spin up a Linux machine (I took a Debian VM) and install docker and git
  • log in as root
  • cd ~
  • git clone --branch oidc https://github.com/Kurnihil/nginx-proxy-manager.git
  • cd ~/nginx-proxy-manager/scripts/ci
  • ./frontend-build
  • cd ~/nginx-proxy-manager/scripts
  • ./buildx
  • docker image ls -> find image without name and write down its ID
  • docker tag IMAGE ID USERNAME/nginx-proxy-manager:TAG
    -> e.g. docker tag e82k4nd2ij dfs90/nginx-proxy-manager:oidc

If you want to push your image to Docker hub:

  • register at Docker hub and generate a personal token (see guides on the internet)
  • docker login -u USERNAME
  • use token as password
  • docker image push USERNAME/nginx-proxy-manager:TAG

The image I generated can be found as "dfs90/nginx-proxy-manager:oidc" on Docker hub and is built on Kurnihil's "oidc" branch.

@Kurnihil :
Sorry for my dumb question:
As I am not capable of "rebasing" the "openidc" branch to "develop" branch myself (I just don't know how to do it):
Is it possible to do an update on your "oidc" branch so that it uses the most recent "develop" branch of the npm project?

Thanks and best regards,
David

@KeinNiemand
Copy link

Is this the same features wise as #2630? Both PR try to add OIDC support yet both seem to have existed for over a year without getting merged.

@oechsler
Copy link

Is this the same features wise as #2630? Both PR try to add OIDC support yet both seem to have existed for over a year without getting merged.

I thing these are different topics. To my understanding this feature is using Open ID Connect as authentication for a proxy host, whilst #2630 uses it to authenticate users on the management interface.

Merge develop in to openidc
Copy link

PR is now considered stale. If you want to keep it open, please comment 👍

@github-actions github-actions bot added the stale label Apr 17, 2025
@DFS-90
Copy link
Contributor

DFS-90 commented May 9, 2025

Please merge this pull request as duplicate "custom-forward-host-help" in "frontend/js/i18n/messages.json" breaks building. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires-verification Waiting for one or more people to confirm the fix stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.