3.91. <AuthBy SQLAUTHBY>

This clause does an SQL lookup for each incoming request to determine the actual Radiator AuthBy Clause to use to handle the request. If the resulting Radiator clause has not previously been used, it is created using parameters retrieved from SQL and the request is given to it for authentication or other handling. If the resulting Radiator clause has been used previously, it is reused and the request is sent to it.
Any database supported by Radiator can be used. A sample configuration file is supplied in the goodies/ directory of your Radiator distribution.
<AuthBy SQLAUTHBY> supports the same parameters as <AuthBy xxxxxx>. For more information, see Section 3.32. <AuthBy xxxxxx>. It supports also all the common SQL configuration parameters. For more information about the SQL configuration parameters, see Section 3.8. SQL configuration.

3.91.1. AuthBySelect

AuthBySelect is the SQL query used to retrieve AuthBy clause configuration parameters based on the user's realm. The clause is cached for reuse. You can use AuthBySelectParam to bind variables to the AuthBySelect query. %0 is replaced with SQL quoted realm when no AuthBySelectParams are configured.
The default value is:
AuthBySelect select HOST, PORT, AUTHDN, AUTHPASSWORD, BASEDN, USERNAMEATTR, \
     PASSWORDATTR, HOLDSERVERCONNECTION from RADSQLAUTHBY where TARGETNAME=%0
This is suitable for an AuthBy LDAP2 clause.

3.91.2. AuthBySelectParam

This optional parameter specifies a bind variable to be used with AuthBySelect. Unquoted realm is available as %0. For more information, see Section 3.8.1. SQL bind variables.
Here is an example of using AuthBySelectParam:
AuthBySelect select HOST, PORT, AUTHDN, AUTHPASSWORD, BASEDN, USERNAMEATTR, \
       PASSWORDATTR, HOLDSERVERCONNECTION from RADSQLAUTHBY where TARGETNAME=?
AuthBySelectParam %0

3.91.3. Class

This parameter defines the type of Radiator AuthBy clause to create. The class name is the type of AuthBy clause to create. For example
Class LDAP2
will cause <AuthBy SQLAYTHBY> to create clauses of type <AuthBy LDAP2>. Defaults to ‘LDAP2’.

3.91.4. DefaultParam

DefaultParam sets a default value for any clause parameter, which may be overridden with a column from the SQL query using ParamColumnDef.
DefaultParam RewriteUsername s/^([^@]+).*/$1/
DefaultParam Version 3

3.91.5. ParamColumnDef

Maps the columns returned by AuthBySelect to parameter names in the target clause. If non-NULL, each will override the corresponding default value given by DefaultParam.
ParamColumnDef 0,Host
ParamColumnDef 1,Port
ParamColumnDef 2,AuthDN
ParamColumnDef 3,AuthPassword