[RADIATOR] Fwd: RewriteUsername with variable from SQL

Gianlu Bol wlasagne at gmail.com
Wed Mar 13 15:45:57 UTC 2019


Hi,

here the option without read the informaton on the database (it's working
but duplicated information)

<Realm example.com>
        AuthByPolicy ContinueWhileAccept

# Rewrite email to username
        RewriteUsername s/^([^@]+)/username1/
        RewriteUsername s/^([^@]+)/username2/
        RewriteUsername s/^([^@]+)/username3/
        RewriteUsername s/^([^@]+)/username4/

        AuthBy RadiusProxy
</Realm>

Option 1 with Database (NOT OK, need to set a fariable)

<AuthBy GROUP>
        Identifier ReplaceUser
        AuthByPolicy ContinueWhileAccept
        <AuthBy SQL>

                DBSource        dbi:mysql:%{GlobalVar:DBname}
                DBUsername      %{GlobalVar:DBuser}
                DBAuth          %{GlobalVar:DBpass}
                AuthSelect select USERNAME \
                        from CONTACT \
                        where EMAIL='%n'
                AuthColumnDef 0, My-User, reply

         </AuthBy>

        <AuthBy GROUP>

                # Email to Username
                RewriteUsername s/^([^@]+)/$myuser/  # variable not set !!
                        <AuthBy RADIUS>

                        Host 192.168.1.50
                        Host 192.168.100.50
                        Secret xxxxx
                        AuthPort 1812

                </AuthBy>

        </AuthBy>

</AuthBy>

<Realm example.com>

        AuthByPolicy ContinueWhileAccept
        #Translate all uppercase to lowercase
        RewriteUsername tr/A-Z/a-z/
        AuthBy ReplaceUser

</Realm>

regards


Il giorno mar 12 mar 2019 alle ore 14:18 Heikki Vatiainen <hvn at open.com.au>
ha scritto:

> On 11/03/2019 23.00, Gianlu Bol wrote:
>
> > Are there any examples with PostAuthSelectHook?
>
> I think the refrence manual has currently the only example specific to
> PostAuthSelectHook. You could see other hooks, for example,
> goodies/hooks.txt for more examples.
>
> One option could be to use paid support list if you are hesitant to post
> more details on this public list.
>
> Thanks,
> Heikki
>
> --
> Heikki Vatiainen <hvn at open.com.au>
>
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. SQL, proxy, DBM, files, LDAP, TACACS+, PAM, Active Directory,
> EAP, TLS, TTLS, PEAP, WiMAX, RSA, Vasco, Yubikey, HOTP, TOTP,
> DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, etc.
> _______________________________________________
> radiator mailing list
> radiator at lists.open.com.au
> https://lists.open.com.au/mailman/listinfo/radiator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.open.com.au/pipermail/radiator/attachments/20190313/756393b0/attachment.html>


More information about the radiator mailing list