Authentication Text File and Structure

This chapter describes the structure of the data storage text files, and of the database files. If you use a database for which there is no included template, create the data source to have the database file structure described herein.

For additional information on identifying which method RealServer is to use, see the AuthDBPlugin configuration setting.


Text Files

When you first install RealServer and the Authentication feature, no text files exist. After you start the RealServer for the first time, it creates the appropriate directory structure and initial text files. Every time you start the RealServer thereafter, it uses these directories and files.

The following directory structure is created under the Commerce directory:

Directory Contents
dbdata ppvbasic.txt
dbdata\users This directory is initially blank
dbdata\guids This directory is initially blank
dbdata\logs reglog.txt, accesslog.txt
dbdata\redirect This directory is initially blank

If you manually edit the files, be sure that any blank (or unused) fields use an asterisk (*) and semi-colon (;) as a placeholder. Spaces are not allowed.

The dbdata directory

This directory contains four subdirectories and one file: ppvbasic.txt.

The ppvbasic.txt file indicates to RealServer that this directory is the location for data storage.

Do not delete the ppvbasic.txt file! If you delete the ppvbasic.txt file, RealServer will rewrite the directories and will erase their prior content.

The dbdata\users Directory

The files in this directory are named username.txt, where username is also the User ID. This directory contains one file per registered user.

The first line of each username.txt file has the following form and is different from subsequent lines in the file:

password;uuid;uuid_writeable

where:

password

If AuthMode is set to 1 (User-based), this stores the password. Otherwise an asterisk (*).

Passwords are encrypted. See "Using the Password Tool" on page 150.

uuid If AuthMode is set to 0 (player-based) this stores playerID. Otherwise, this field is an asterisk (*). Uuid or password will be an asterisk *; depends on AuthMode configuration setting.
uuid_writeable A flag set and used by the Server: (0=playerID is in database, 1=record created, but playerID not yet registered)

The second and subsequent lines of each username.txt file have the following form (for further detail on allowable values in each field, see database structure later in this chapter):

url;url_type;permission_type;expires;debitted_time

Example

The example file user1.txt has the following content, when AuthMode is 0:

*;00001d00-0901-11d1-8b06-00a024406d59;0
/secure/clip1.rm;0;0;*;*
/secure/directory;1;0;*;*
/secure/time.rm;0;2;*;300
/secure/time.rm;0;1;05/24/1970:06:12:32;300

The dbdata\guids Directory

The files in this directory are given the names of the GUIDs from the registered RealPlayers, one per registered user. Each file contains only the name of the associated user name. For example, a file such as "1234this2is3my4guid89" contains the name of the user, "user1".

The dbdata\logs Directory

This directory contains two files: reglog.txt and accesslog.txt.

Reglog.txt

Each line of this file represents the result of an attempt to register a visitor.

The reglog.txt file has the following format:

Syntax

status;userid;uuid;IP;register_time;url_redirect

where:

status

Result of user's attempt to connect.

0 = Success

1 = Failed (playerID not readable)

2 = Failed (playerID not unique-already registered under different username)

3 = Failed (3.0 Player or older)

userid Unique name of up to 50 characters.
uuid If AuthMode is set to 0 (Player-based) this stores playerID.
ip IP address from which user is attempting to connect.
request_time Time of connection request.
url_redirect If connection failed, URL to which user was redirected (see redirect.txt).

Example

0;user1;00001d00-0901-11d1-8b06-00a024406d59;255.255.255.0;
14:07:63;*
2;user2; 00001d02-0901-11d1-8b06-00a024406d59;255.255.255.0;
14:08:63;http://redirect.com/url.html

Accesslog.txt

Each line of accesslog.txt describes the result of an attempt to view a clip.

Syntax

status;userid;uuid;ip;url;permission_type;
permission_on;start_time;end_time;total_time;
why_disconnect

where:

status Result of user's attempt to connect. 0 = Success, 1=playerID not readable, 2=playerID non-unique (already registered under different username) 3=no username (unique record with username not yet created).
userid Unique name of up to 50 characters.
uuid If AuthMode is set to 0 (Player-based), this stores playerID.
ip IP address from which user is attempting to connect.
url Secured clip user is attempted to access.
permission_ type Permission type associated with access: 0=event-based, 1=calendar, 2=duration, 3=none
permission_on Permission type associated with url: 0=file (individual clip), 1=directory, 2=none.
start_time Time/date clip started playing.
end_time Time/date clip stopped playing.
total_time Total time clip played.
why_disconnect 0=client disconnected voluntarily, 1=server access expired (duration exceeded time banked or calendar date set).



Example

0;user1;1234this2is3my4guid89;255.255.255.0;/secure/
clip1.rm;0;0;14:07:63;14:08:64;00:01:01;0

The dbdata\redirect Directory

The redirect directory contains files named after URLs that are restricted from unauthorized users. Within each file is the alternate URL to which RealServer sends the user if he or she tries to click the restricted URL.

If no files are present in this directory, and the user attempts to click a URL to which he or she has not been given access, the user receives an error message.

Because certain characters that appear in URLs are illegal in file names, RealServer requires a substitution for these illegal symbols.

This character… …is replaced with this sequence:
/ +2f
\ +2b
+ +5c

Thus, the URL "Secure/TopSecret.rm" would be converted to "Secure+2fTopSecret.rm."

The URL within each file, however, is represented normally.


Database structure

This section describes the structure of the database templates included with RealServer. If you create your own database files to use with RealServer, use the format described here.

By default, RealServer uses text files (described in the preceding section) and not database files.

The database templates include five tables:

The Users and Permissions tables are the most important; they contain the lists of who's registered and with what permissions.

users Table
userid User name of up to 50 characters. Ties to Permissions table.
password

If AuthMode is set to 1 (User-based), this stores the password. Otherwise blank.

Passwords are encrypted. See "Using the Password Tool" on page 150.

uuid If AuthMode is set to 0 (Player-based) this stores playerID. Otherwise blank.
uuid_writeable A flag set and used by the server: 0=playerID is in database, 1=record created, but playerID is not yet registered with the server.

 

permissions Table
userid User name of up to 50 characters. Ties to Users table.
url URL of secure directory or clip.
url_type Whether URL is directory or clip: 0 = directory, 1 = clip.
Permission_type Access type: 0 = event-based, 1 = calendar, 2 = duration
expires if permission_type = 1, this is expiration date/time, in format MM/DD/YYYY:HH:MM:SS. Otherwise blank.
debitted_time if permission_type = 2, this is time remaining (in seconds) Otherwise blank.


redirect Table
url URL of any secure clip or directory.
url_redirect URL to which users could be redirected to if they are not allowed access to that clip. New URL must NOT be a secure URL.

 

register_log Table
status

Result of user's attempt to connect:

0 = Success

1 = Failed (playerID not readable)

2 = Failed (playerID not unique-already registered under different username)

3 = Failed (3.0 Player or older)

userid Unique name of up to 50 characters.
uuid If AuthMode is set to 0 (Player-based) this stores playerID. Otherwise blank.
ip IP address from which user is attempting to connect.
request_time Time of connection request.
url_redirect If connection failed, URL to which user was redirected (see Redirect Table, above).

 

access_log Table
status Result of user's attempt to connect: 0 = access to clip granted, 1=denied
userid Unique name of up to 50 characters.
uuid If AuthMode is set to 0 (Player-based) this stores playerID. Otherwise blank.
ip IP address from which user is attempting to connect
url Secured clip user is attempted to access.
permission_type Permission type associated with access: 0=event-based, 1=calendar, 2=duration, 3=none
permission_on Permission type associated with url: 0=file (individual clip), 1=directory, 2=none.
start_time Time/date clip started playing.
end_time Time/date clip stopped playing.
total_time Total time clip played.
why_disconnect 0=client disconnected voluntarily, 1=server access expired (duration exceeded time banked or calendar date set).

© 1997 RealNetworks, Inc.