SQL Authentication Header Files
The header files used to configure SQL authentication methods must have the .aut extension; for example, radsql.aut. The format of a header file is comparable to that of a Windows INI file: it is composed of several sections; section names are enclosed in brackets; each section may contain multiple parameter/value pairs.
[Bootstrap] Section
The [Bootstrap] section (Table 123) of the SQL authentication header file specifies information that Steel-Belted Radius Carrier uses to load and start an SQL authentication method.
[Bootstrap]LibraryName=radsql.auth_ora.soEnable=0InitializationString=SQLAcceptsAuthorizeOnly=1
[FailedSuccessResultAttributes] Section
The [FailedSuccessResultAttributes] section (Table 124) of the SQL authentication header file can be used to map any RADIUS attribute returned from the database. Attributes can be specified in two ways:
- Attributes can be specified with a literal value enclosed in single quotes. Values must be enclosed with single quotes, even when they represent numeric values.
- Attributes can be specified with a numeric value that corresponds to the ordering of values returned from the SQL select statement.
Precede attribute names with @ and enter them as they appear in the dictionary (.dct) files, or the subattribute dictionary (.jdict) files. Enclose attribute values (including integers and IP addresses) in single quotes. For example:
[FailedSuccessResultAttributes]@Reply-Message = 'Please re-enter your password.'@Filter-Id = '3'[Failure] Section
The [Failure] section of the SQL authentication header file can be used to determine the result of the authentication process (accept or reject) when connectivity to all of the configured SQL databases has failed. For example:
[Failure]Accept = 1Profile = XYZFullName = Unauthenticated!
NOTE: The Profile option and the Alias option cannot be used together. Read the following descriptions and choose the one that suits your needs.
[Results] Section
The [Results] section (Table 125) of the SQL authentication header file maps the columns named in its SELECT query to the type of data that Steel-Belted Radius Carrier expects these columns to contain.
[Results]Password=1/48Profile=2/48The following parameters (Table 125) may be present in a [Results] section. Each parameter represents a type of data required to authenticate an Access-Request, and if desired, apply authorization information as well.
NOTE: The Profile option and the Alias option cannot be used together. Read the following descriptions and choose the one that suits your needs.
Consider the following SELECT statement:
SELECT user_pwd, attribs, fullname FROM rasusers WHERE user_id = %namewhere user_pwd, attribs, fullname, and user_id are the names of columns in the SQL table, and rasusers is the name of the SQL table itself. The [Results] section of this header file must map the SQL table columns user_pwd, attribs, and fullname to authentication and/or authorization data types; for example.
[Results]Password=1Profile=2FullName=3Columns in the SQL query are identified in the [Results] section by number; 1 represents the first column in the SELECT query (from left to right), and if other columns are also referenced, 2 represents the second, and 3 the third.
Along with a number representing the column order, each entry in the [Results] section also specifies the storage format of the column in the SQL table, using the same slash (/), length, and type conventions as the SQL query.
Default [Results] Parameters
The DefaultResults flag in the [Settings] section of radsql.auth_ora.so specifies whether default values for Password, Profile, Alias, and FullName are automatically bound to the returned SQL data. The default radsql.auth_ora.so file sets it to 0.
With DefaultResults=0, the results list is no longer automatically bound, and only explicit columns in the [Results] section, or embedded Parameters to a stored procedure, are used. This is the recommended setting.
The DefaultResults=1 option remains only for backward-compatibility with old .aut files that rely on the default results behavior to ensure that the set of default columns are automatically bound.
[Server] Section
Steel-Belted Radius Carrier can maintain multiple SQL server connections and authenticate users against authentication databases in a round-robin fashion. This convention distributes the authentication workload across several servers.
The [Server] section (Table 126) of the SQL authentication header file gives Steel-Belted Radius Carrier a pool of servers from which to create the round-robin list. The [Server] section names each server that might be used. It also provides rules for when to include or exclude each of the possible servers in the round-robin list.
[Server]ServerName=TargetNumberServerName=TargetNumber...
The name of the header file section that contains configuration information for that server.
An activation target number, a number that controls when this server is activated for backup purposes.
A Steel-Belted Radius Carrier server maintains connectivity with its SQL servers according to the following rules:
- The priority of the server by order. The first entry in the [Server] section has the highest priority.
- By activation target number. The rule for the activation target is that if the number of SQL servers to which Steel-Belted Radius Carrier is connected is less than the activation target, Steel-Belted Radius Carrier connects to the server and includes it in the round-robin list. While the number of active servers is equal to or greater that the activation target, Steel-Belted Radius Carrier does not use that server in the round-robin list. An activation target of 0 indicates that, in the current configuration, this machine is never used.
[Server/name] Sections
You must provide a [Server/
name] section for each server you named in the [Server] section:[Server/name]Connect=username/password@servicename
where the values forusernameandpasswordare specific to the SQL database, andservicenameis the Oracle service name.
NOTE: Do not use the SA account or leave the password blank.
Last Resort Server
You may identify a "last resort" SQL server by providing a LastResort parameter in one of these [Server/
name] sections, and setting its value to 1. If a SQL query against some other server results in "no record found," the authentication server tries the last resort server before accepting or rejecting the user.In the following example, server s3 is the last resort server. The @mydb string refers to the service name for an Oracle database in the tnsnames.ora file (the server cannot connect to the Oracle database without this).
[Server]s1=2s2=2s3=1[Server/s1]Connect=system1/manager[Server/s2]Connect=system2/manager@mydb2[Server/s3]Connect=system3/manager@mydb3LastResort = 1You might use the LastResort parameter to identify your master accounts database. This enables Steel-Belted Radius Carrier to authenticate the user in the case where a user account is newly added to the master accounts database but has not yet been propagated to all the SQL databases.
[Settings] Section
The [Settings] section (Table 127) of the SQL authentication header file defines parameters that control the database connection.
[Settings]Connect=DSN=<dsn_name_here>;UID=<username_for_dB>;PWD=<password_for _dB>SQL=SELECT password, profile FROM userlist WHERE name = %name/40ParameterMarker=?MaxConcurrent=1ConcurrentTimeout=30ConnectTimeout=25QueryTimeout=25WaitReconnect=2MaxWaitReconnect=360PasswordFormat=0DefaultResults=0ErrorMap=oracle.ini
Specifies the number of seconds a request may wait for execution before it is discarded. Because there may be only up to MaxConcurrent SQL statements executing at one time, new requests must be queued as they arrive until other statements are processed.
NOTE: The MaxConcurrent parameter is valid only for Oracle SQL authentication (radsql.aut). It is not valid for JDBC SQL authentication (radsqljdbc.aut).
Specifies the string that must be passed to the database client engine to establish a connection to the database. This string has (or refers to) information about the name of the database, its location on the network, the password required to access it, and so forth.
The format of the connect string depends on the type of database you use:
Oracle:
Connect=<dB_username>/<dB_password>JDBC: Connect=DSN=<jdbc:provider:driver:dsn_name_here>;UID=<username_for_dB>;PWD=<password_for_dB>
(JDBC only) Specifies the character used to separate fields (DSN, UID, PWD) in the connect string.
Default value is ; (semicolon). If the JDBC connect string requires use of semicolons as part of a field value, you can use this parameter to specify a different delimiter, such as ^ (caret).
Specifies the number of seconds to wait when attempting to establish the connection to the database before timing out.
This value is ignored if the client database engine does not support this feature.
- If set to 0, no default values are assumed and the user must explicitly enter all result items (if you are not calling a stored procedure).
- If set to 1, the default values for Results are used. This is the backward-compatibility setting and the setting if no value is specified in the file. In this case, each Result item must be explicitly specified.
(JDBC only) Specifies the third-party JDBC driver to load for authentication. For example:
Driver=com/provider/jdbc/sqlserver/
SQLServerDriverNOTE: Third-party JDBC drivers must be installed in /radius/jre/lib/ext. Refer to the JDBC driver documentation for information on how to install the JDBC driver and supporting files.
Specifies the name of the file that contains the native error codes that are treated as soft errors (that is, errors that do not require Steel-Belted Radius Carrier to disconnect from and reconnect to the remote database).
NOTE: Steel-Belted Radius Carrier includes three default error map files: mssql.ini (for Microsoft SQL using ODBC), mysql.ini (for MySQL using JDBC), and oracle.ini (for Oracle using OCI). See Chapter 13, "Database Error Map Files" on page 273 for information on configuring error map files.
Activates logging for the SQL authentication component and sets the rate at which it writes entries to the server log file (.LOG). The LogLevel may be the number 0, 1, or 2, where 0 is the lowest logging level, 1 is intermediate, and 2 is the most verbose. If the LogLevel that you set in the .aut file is different than the LogLevel in radius.ini, the radius.ini setting determines the rate of logging.
Specifies the maximum number of instances of a single SQL statement that may be executing at one time.
NOTE: The MaxConcurrent parameter is valid only for Oracle SQL authentication (radsql.aut). It is not valid for JDBC SQL authentication (radsqljdbc.aut).
NOTE: A setting of MaxConcurrent = 1 is sufficient for all but the most demanding environments. Increase this value slowly and conservatively. For more information, see Overlapped Execution of SQL Statements in Chapter 18, Configuring SQL Authentication of the Steel-Belted Radius Carrier 7.2 Administration and Configuration Guide.
Specifies the maximum number of seconds to wait after successive failures to reconnect after a failure of the database connection.
WaitReconnect specifies the time to wait after failure of the database connection. This value is doubled on each failed attempt to reconnect, up to a maximum of MaxWaitReconnect.
Specifies the character or sequence of characters used as the parameter marker in a parameterized SQL query. Normally, this is the question mark (?), but this can vary among database vendors.
- If set to 0, Steel-Belted Radius Carrier tries to determine password format automatically.
- If set to 3, Steel-Belted Radius Carrier expects the password value encrypted with UNIXcrypt.
By default, the PasswordFormat parameter is not listed in the [Settings] section of the .aut file.
Specifies the number of seconds to wait for a response to a query before timing out. This value is passed to the client database engine, which may or may not implement the feature.
Specifies the SQL statement used to access the password information in the database. The SQL statement may be broken over several lines by ending each line with a backslash. The backslash must be preceded by a space character, and followed by a newline character. The subsequent lines may be indented for better readability.
SQL=SELECT password, profile, fullname \
FROM usertable \
WHERE username = %name/63sSpecifies the string that is the expected result of a successful authentication, to be compared to the %result parameter.
If a value is specified for this field, it is used in the following manner upon execution of the SQL statement: if the value of %result is not equal to the value given for this field, the user is rejected. The test for textual equality is not case sensitive.
No such test, or rejection, is performed if no value is specified for this field.
This is a useful technique for coordinating with the custom functionality of stored procedures.
Specifies whether the user's login name is converted to uppercase characters before using it in the SQL statement execution.
Specifies the number of seconds to wait after a failure of the database connection before trying to connect again.
[Strip] Sections
The [Strip] sections (Table 128) of the SQL authentication header file (Table 128) allow User-Name stripping to occur. These sections enable Steel-Belted Radius Carrier to identify the username that the SQL database expects by stripping the incoming User-Name attribute value of realm names and other "decorations."
You may or may not need to employ User-Name stripping for SQL authentication. Your need for this feature depends upon the naming conventions that you employ on your network and in your SQL database entries. The SBR Carrier usual name parsing features work independently of this feature.
The following [Strip] syntax is available to enable and configure User-Name stripping for SQL authentication:
[Strip]Authentication=Yes[StripPrefix]StringStringM[StripSuffix]StringStringM