Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation  Back up to About Overview 
  
[+] Expand All
[-] Collapse All

RealmSelector Object

Objects of the RealmSelector class are used to execute built-in Steel-Belted Radius Carrier realm selection methods from realm selection scripts. To use the RealmSelector class, scripts must first create an object instance by calling the new RealmSelector() constructor.

Constructor

new RealmSelector()

Purpose

The new RealmSelector() constructor is used to create a new object instance of the RealmSelector class.

Syntax

new RealmSelector()

Parameters

Nothing.

Returns

The new RealmSelector() object reference.

Example

filter = new RealmSelector();

new CSTAccessor()

Purpose

The new CSTAccessor() constructor is used to create a new object instance of the CSTAccessor class.

Syntax

new CSTAccessor(fieldNameArray)

Parameters

Table 148: new CSTAccessor() Parameters

Parameter

Description

fieldNameArray

This is an array of strings and each string is the name of a CST field that may be read in a future Get() operation. If a field is not named in the fieldNameArray parameter, an error is returned if it is an argument to a Get() method for this instance.

Returns

The new CSTAccessor() object reference. If there is no CST record associated with this JavaScript instance (the current radius transaction), the script terminates and returns SBR_RET_FAILURE.

Example

var myFields = new Array (“Sbr_UserName,” “Sbr_IpPoolName,“ “Sbr_NasName“);var CST = new CSTAccessor(myFields);

new SessionControl()

Purpose

The new SessionControl() constructor is used to create a new object instance of the SessionControl class.

Syntax

new SessionControl()

Parameters

Nothing.

Returns

The new SessionControl() object reference. If there is no CST record associated with this JavaScript instance, the script terminates and returns SBR_RET_FAILURE.

Example

success = (sc.Execute() == SessionControl.SUCCESS);

RealmSelector Methods

These methods are provided to execute built-in realm selection methods, set the authentication username passed to the selected directed or proxy realm, and set the user profile upon return from the realm.

Execute()

Purpose

The Execute() method is used to execute built-in Steel-Belted Radius Carrier realm selection methods.

Syntax

selector.Execute(method)

Parameters

Table 149: Execute() Parameters—RealmSelector Methods

Parameter

Description

method

Specifies the name of the realm selection method: prefix, suffix, dnis, attribute-mapping, or undecorated.

Returns

The selected realm name or JavaScript null if no realm is matched.

Example

selector.Execute(“suffix” );

Note: Before you can execute the prefix or suffix built-in methods, you must enable them in the proxy.ini file. If a script has been declared in the [Processing] section of the proxy.ini file, then the prefix and suffix methods are enabled automatically. However, if a script has been declared in an [Inner_Authentication] section of a tunneled .aut file of an authentication method (TTLS, or PEAP), then you must explicitly declare the prefix and suffix methods in the [Processing] section of the proxy.ini file.

SetAuthUserName()

Purpose

The SetAuthUserName() method is used to set the authentication username for the request.

Syntax

selector.SetAuthUserName(username)

Parameters

Table 150: SetAuthUserName() Parameters—RealmSelector Methods

Parameter

Description

username

Specifies the desired authentication username.

Returns

Nothing.

Example

selector.SetAuthUserName(“RButler” );

SetAuthProfile()

Purpose

The SetAuthProfile() method is used to set the profile to be returned upon successful authentication.

Syntax

selector.SetAuthProfile(profile)

Parameters

Table 151: SetAuthProfile() Parameters—RealmSelector Methods

Parameter

Description

profile

Specifies the profile name.

Returns

Nothing.

Example

selector.SetAuthProfile(“Profile1” );

SetLocationGroupProfile()

Purpose

The SetLocationGroupProfile() method is used to set the profile to be returned upon successful authentication.

Syntax

selector.SetLocationGroupProfile(profile)

Parameters

Table 152: SetLocationGroupProfile() Parameters—RealmSelector Methods

Parameter

Description

location group profile

Specifies the location group profile name.

Returns

Nothing.

Example

selector.SetLocationGroupProfile(“Profile1” );

CSTAccessor Methods

These methods are provided to get a field value from the CST for the current session.

Get()

Purpose

The Get() method is used to get a field value from the CST for the current session.

Syntax

Get(name)

Parameters

Table 153: Get() Parameters—CSTAccessor Methods

Parameter

Description

name

Specifies the name of the CST field.

Returns

The value of the CST field for this session. For standard fields, the JavaScript type of the return value is similar to the AttributeFilter.Get() method for the attribute used to create a particular field, listed in Table 164. For user-created fields, the JavaScript type is either a string or integer. If the field name passed as a parameter is not one of the fields passed into the constructor, the script terminates and returns a SBR_RET_FAILURE return code.

Example

var username = CST.Get(“Sbr_UserName”);

SetAuthUserName()

Purpose

The SetAuthUserName() method is used to set the authentication username for the request.

Syntax

selector.SetAuthUserName(username)

Parameters

Table 154: SetAuthUserName() Parameters—CSTAccessor Methods

Parameter

Description

username

Specifies the desired authentication username.

Returns

Nothing.

Example

selector.SetAuthUserName(“RButler” );

SetAuthProfile()

Purpose

The SetAuthProfile() method is used to set the profile to be returned upon successful authentication.

Syntax

selector.SetAuthProfile(profile)

Parameters

Table 155: SetAuthProfile() Parameters—CSTAccessor Methods

Parameter

Description

profile

Specifies the profile name.

Returns

Nothing.

Example

selector.SetAuthProfile(“Profile1” );

SetLocationGroupProfile()

Purpose

The SetLocationGroupProfile() method is used to set the profile to be returned upon successful authentication.

Syntax

selector.SetLocationGroupProfile(profile)

Parameters

Table 156: SetLocationGroupProfile() Parameters—CSTAccessor Methods

Parameter

Description

location group profile

Specifies the location group profile name.

Returns

Nothing.

Example

selector.SetLocationGroupProfile(“Profile1” );

Modified: 2017-09-27