jeremyschulman / netbox-plugin-auth-saml2

Netbox plugin for SSO using SAML2
119 stars 21 forks source link

Plugin URL's not working - running in docker #54

Closed kguest closed 2 years ago

kguest commented 2 years ago

Hi,

I'm trying to integrate the SAML plugin with Netbox via docker.

I've managed to confirm the plugin is loading (at least I think it is) as the authentication gets forwarded to my IDP when I navigate to

However, once my IDP passes the authentication back to Netbox I get the error

I'm assuming this has something to do with how I'm proxying the traffic to the container - I'm using Caddy for SSL and I'm unsure of how to replicate nginx.conf settings or even if it is possible.

Here is my Caddyfile:

# ./Caddyfile
netbox.XXXX.com {

    handle {
      reverse_proxy http://netbox:8080
      encode gzip zstd
    }

    tls /etc/ssl/private/netboxcert.crt /etc/ssl/private/netbox.key

    log {
      level error
    }

}

Any help or pointers appreciated, thanks.

kguest commented 2 years ago

Have managed to solve this so will leave my new Caddy file here in case anyone else needs the help:

 ./Caddyfile
netbox.XXXX.com {

    handle_path /login/* {
      rewrite * /api/plugins/sso/login/
      reverse_proxy http://netbox:8080
      encode gzip zstd
    }

    handle_path /sso/* {
      rewrite * /api/plugins/sso/{path}
      reverse_proxy http://netbox:8080
      encode gzip zstd
    }

    handle {
      reverse_proxy http://netbox:8080
      encode gzip zstd
    }

    tls /etc/ssl/private/netboxcert.crt /etc/ssl/private/netbox.key

    log {
      level error
    }

}