Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Authentication with Google Workspace using FreeRadius and STunnel

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 2 Posters 508 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      leonida368
      last edited by

      Good morning everyone, I implemented a captive portal some time ago. It's based on a Google Workspace authentication mechanism that works very well.
      It involves creating an LDAP app on Google Workspace and then downloading the key, certificate, and credentials generated for binding.
      Then I configured Stunnel, the native PfSense LDAP module, and the captive portal.
      For a variety of reasons, however, I decided to use the PfSense FreeRadius package instead of the native LDAP module.
      I followed the steps outlined in multiple guides, but the authentication test in Diagnistic always fails.
      I've attached some screenshots of the current FreeRadius configuration.
      7b035d62-eb08-4193-b234-83396f71025f-image.png
      7666b286-1ac1-4f1c-9a2f-69b8d6e85543-image.png
      de96c84f-3cdd-4818-b768-e0103c247990-image.png
      f4ec16ab-fe67-4b8d-9c68-65d8d07f1360-image.png
      a28f2648-7987-47d8-a1b2-0beac026b6fa-image.png
      30ea15fc-e037-4b59-8245-1972f12954aa-image.png
      b9b15089-c6dc-4aac-a849-96add5742aee-image.png
      Where am I going wrong?
      Thanks in advance.

      stephenw10S 1 Reply Last reply Reply Quote 0
      • stephenw10S Offline
        stephenw10 Netgate Administrator @leonida368
        last edited by stephenw10

        Anything logged when you try to authenticate?

        I assume local Radius users are recognized as expected?

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          leonida368 @stephenw10
          last edited by

          @stephenw10 said in Authentication with Google Workspace using FreeRadius and STunnel:
          Hi,

          Anything logged when you try to authenticate?

          (0) Login incorrect (Failed retrieving values required to evaluate condition): [garottotest] (from client localhost port 0)

          I assume local Radius users are recognized as expected?

          I don't have any local Radius users. Is this something worth trying?

          1 Reply Last reply Reply Quote 0
          • stephenw10S Offline
            stephenw10 Netgate Administrator
            last edited by

            Yes I would test each part of the process individually if you can.

            I would also check for states on the ports set when you test. Is it actually trying to connect to Google LDAP?

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              leonida368 @stephenw10
              last edited by leonida368

              @stephenw10 Local authentication works.
              However, I have some doubts about some fields in the LDAP tab:
              Identity > should it be just the username or also the domain?
              Base DN > is this correct? The client's Google Workspace domain is liceogarotto.it
              Filter > is this correct?
              Base filter > should it be left blank?
              Based on the screenshots I attached, are there other fields that might not be correct?
              Thanks

              1 Reply Last reply Reply Quote 0
              • stephenw10S Offline
                stephenw10 Netgate Administrator
                last edited by

                I can't really comment on the specific LDAP query. There are a lot of possibilities there and it feels like a minefield whenever I have to use it!

                But check that Radius is at least sending the query and opening a state.

                L 1 Reply Last reply Reply Quote 0
                • L Offline
                  leonida368 @stephenw10
                  last edited by

                  @stephenw10 I definitely think so. I'll send you the complete logs, which also show Stunnel's activity.

                  Apr 13 16:45:36 radiusd 6710 (7) Login incorrect (Failed retrieving values required to evaluate condition): [garottotest] (from client localhost port 0)
                  Apr 13 16:45:36 stunnel 78612 LOG6[41]: Session id: A8BAA329F0626407B8FF4528DB1AC44591BB6B72B264CE628710BA2B53B80230
                  Apr 13 16:45:36 stunnel 78612 LOG6[41]: Session id: 73781DE64B28C6608DACBD56BFA128617B452A4A337EF220DD91BF1DB5EA3EC8
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: Session id: CAEB40BFABC9B02A5E679CC6B883D363EA7AD40817AC43A39F13B397842F8D14
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: Peer temporary key: X25519, 253 bits
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: TLSv1.3 ciphersuite: TLS_AES_256_GCM_SHA384 (256-bit encryption)
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: TLS connected: previous session reused
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: OCSP: Certificate chain verification disabled
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: Peer certificate not required
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: SNI: sending servername: ldap.google.com
                  Apr 13 16:45:35 stunnel 78612 LOG5[41]: Service [GoogleWorkspace] connected remote server from 192.168.0.55:1828
                  Apr 13 16:45:35 stunnel 78612 LOG5[41]: s_connect: connected 216.239.32.58:636
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: s_connect: connecting 216.239.32.58:636
                  Apr 13 16:45:35 stunnel 78612 LOG6[41]: failover: priority, starting at entry #0
                  Apr 13 16:45:35 stunnel 78612 LOG5[41]: Service [GoogleWorkspace] accepted connection from 127.0.0.1:59046
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: Session id: CAEB40BFABC9B02A5E679CC6B883D363EA7AD40817AC43A39F13B397842F8D14
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: Session id: 599E49101A06DBCB47C5186AD416ED5AC692F81EE2AA2F1B6745ABC19F23AB18
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: Session id: A5C9C215BDB89CCF65CC35BA0233B4B85810EA321F3DC3FBF2C4D9D3B3DFC4BF
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: Peer temporary key: X25519, 253 bits
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: TLSv1.3 ciphersuite: TLS_AES_256_GCM_SHA384 (256-bit encryption)
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: TLS connected: previous session reused
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: OCSP: Certificate chain verification disabled
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: Peer certificate not required
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: SNI: sending servername: ldap.google.com
                  Apr 13 16:45:34 stunnel 78612 LOG5[40]: Service [GoogleWorkspace] connected remote server from 192.168.0.55:28209
                  Apr 13 16:45:34 stunnel 78612 LOG5[40]: s_connect: connected 216.239.32.58:636
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: s_connect: connecting 216.239.32.58:636
                  Apr 13 16:45:34 stunnel 78612 LOG6[40]: failover: priority, starting at entry #0
                  Apr 13 16:45:34 stunnel 78612 LOG5[40]: Service [GoogleWorkspace] accepted connection from 127.0.0.1:62544

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S Offline
                    stephenw10 Netgate Administrator
                    last edited by

                    Yup OK that looks pretty conclusive.

                    Can you get any sort of logs from the Google side?

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                    Privacy Policy · Cookie Policy