Ad Widget

Collapse

Zabbix - OKTA SAML wrong redirect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bagahe
    Junior Member
    • Nov 2021
    • 15

    #1

    Zabbix - OKTA SAML wrong redirect

    Hey Everyone,

    I have some issues configuring Zabbix (version 5.4) with OKTA as SAML. The configuration seems to work fine and it does the OKTA redirection just fine, but when I input the OKTA credentials and they are OK and I am being redirected back to zabbix, I get a 404:

    Click image for larger version

Name:	1.png
Views:	1627
Size:	11.1 KB
ID:	435953

    I've followed the documentation and this is the current configuration I have on Zabbix for the SAML options:

    Click image for larger version

Name:	2.png
Views:	1526
Size:	36.6 KB
ID:	435954


    Any ideas where the error might be? Have I missed something?

    Best Regards,

  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    This is just a wild guess, but does it make a difference if you use https (instead of http) for both the Okta IdP and the Zabbix return URL?

    Comment

    • bagahe
      Junior Member
      • Nov 2021
      • 15

      #3
      Hi Tim,

      Thanks for the feedback. I tried with https on the Okta IdP and got the same result. The redirected url is the same one; which is still not found and is already on https.

      Best Regards,

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Ok, thanks for testing that. PHP sometimes does some "magical" things in the name of security if it believes the connection is not secure, so I wanted to rule out that it wasn't something related to PHP stripping something out because it detected part of the process was over an insecure connection.

        Are you using Apache httpd or nginx as the web server? Can you increase the log level for URL handling, including proxying, to see if there's a clue in there about why this isn't working?

        Comment

        • bagahe
          Junior Member
          • Nov 2021
          • 15

          #5
          Hi Tim,

          Thanks for your support and apologies for the delay.

          We are using Apache httpd. We are not running it behind a proxy. I did the whole SSO authentication process, including the notification from OKTA and here are the logs from the webserver, where you can see the 404 and 302 issues:
          Click image for larger version

Name:	zbx_logs.png
Views:	1561
Size:	114.5 KB
ID:	436360
          Which is pretty much the same info we get from Chrome's Network Console:
          Click image for larger version

Name:	zabx_logs2.png
Views:	1536
Size:	24.5 KB
ID:	436361

          Is there any other information from my side that can help debug this topic?

          Best Regards.

          Comment

          • tim.mooney
            Senior Member
            • Dec 2012
            • 1427

            #6
            When you say you're not proxying, do you mean you're using mod_php7 rather than a PHP-FPM worker pool for PHP?

            If you remove the "?acs" from the URL that's configured, does Okta get a different HTTP response?

            Comment

            • bagahe
              Junior Member
              • Nov 2021
              • 15

              #7
              Hi Tim,

              No, we are using PHP-FPM, I meant that the the service is not running behind a reverse proxy or anything like that.

              /ui/index_sso.php is also giving a 404:
              Click image for larger version

Name:	404_php.png
Views:	1476
Size:	11.9 KB
ID:	436507

              Comment

              • Steve.B
                Junior Member
                • Jul 2021
                • 7

                #8
                Have you setup a DNS entry for mps-zabbix.monolithicpower.com?? the subdomain does not resolve for me.

                Comment

                • bagahe
                  Junior Member
                  • Nov 2021
                  • 15

                  #9
                  Hi Steve,


                  Yes, it´s definitely reachable from the internal network:

                  Click image for larger version

Name:	dns_zbx.png
Views:	1451
Size:	8.5 KB
ID:	436534

                  Best Regards,

                  Comment

                  • Steve.B
                    Junior Member
                    • Jul 2021
                    • 7

                    #10
                    Guessed it might be an internal lookup only got to be carefulthese days lol

                    Looking at the URL in the screenshot, you're trying to go to mps-zabbix.monolithicpower.com/ui/index_sso.php. Looking at my zabbix install the ui directory doesn't exist and the index_sso.php in the / dir so mps-zabbix.monolithicpower.com/index_sso.php with our the ui sub folder.


                    Originally posted by bagahe
                    Hi Tim,

                    No, we are using PHP-FPM, I meant that the the service is not running behind a reverse proxy or anything like that.

                    /ui/index_sso.php is also giving a 404:
                    Click image for larger version  Name:	404_php.png Views:	6 Size:	11.9 KB ID:	436507
                    Last edited by Steve.B; 14-12-2021, 18:00.

                    Comment

                    • bagahe
                      Junior Member
                      • Nov 2021
                      • 15

                      #11
                      Hi Steve,


                      I´ve changed things to match the documentation and it looks like I have some progress, but still stuck on URL redirection after OKTA authentication:

                      Click image for larger version

Name:	urls_zbx.png
Views:	1480
Size:	14.9 KB
ID:	436542

                      These are the settings I have on OKTA SAML:

                      Click image for larger version

Name:	saml_okta.png
Views:	1459
Size:	29.7 KB
ID:	436543

                      Thank you very much for your help so far.


                      Best Regards,

                      Comment

                      • Steve.B
                        Junior Member
                        • Jul 2021
                        • 7

                        #12
                        TBH I've not used any SAML soloutions "yet" is there any settings withing OKTA? the error message seems to points that http is being returned to instead of https.

                        Comment

                        • bagahe
                          Junior Member
                          • Nov 2021
                          • 15

                          #13
                          So, after some digging, I've fixed the issue.

                          Here's the solution: Set BaseURL for SAML authentication when behind a reverse-proxy · Issue #614 · zabbix/zabbix-docker (github.com)

                          Even if you are not using it on a docker container and doing it on /etc/zabbix/web/zabbix conf file, these are the settings that you have to add in order to get it working.
                          ZBX_SSO_SETTINGS={"strict":false, "baseURL":"https://<fqdn>/", "use_proxy_headers":true}

                          Leaving this here in case someone else finds this on google or digging though the forums.

                          Comment

                          Working...