Class: SystemAuthenticationScriptBuilder

SystemAuthenticationScriptBuilder

new SystemAuthenticationScriptBuilder()

A builder that can be used to create scripts for use with Session.security#updateSystemAuthentication.

Facilitates producing scripts that contain the mapping of roles to specific principals/passwords.

Methods

abstainAnonymousConnections() → {SystemAuthenticationScriptBuilder}

Instruct the system authentication handler to defer authentication decisions for anonymous connections to subsequent handlers.
Returns:
A new builder containing the abstain anonymous connections command.
Type
SystemAuthenticationScriptBuilder

addPrincipal(principal, password, roles) → {SystemAuthenticationScriptBuilder}

Add a principal.
Parameters:
Name Type Argument Default Description
principal String The principal name
password String The principal's password
roles Array.<String> <optional>
[] The assigned roles for the principal
Returns:
A new builder containing the new principal
Type
SystemAuthenticationScriptBuilder

allowAnonymousConnections(roles) → {SystemAuthenticationScriptBuilder}

Instruct the system authentication to allow anonymous connections.
Parameters:
Name Type Argument Default Description
roles Array.<String> <optional>
[] The roles to assign to anonymous sessions
Returns:
A new builder containing the allow anonymous connections command.
Type
SystemAuthenticationScriptBuilder

assignRoles(principal, roles) → {SystemAuthenticationScriptBuilder}

Change a principal's assigned roles.
Parameters:
Name Type Description
principal String The principal name.
roles Array.<String> An array of roles
Returns:
A new builder containing the changed roles
Type
SystemAuthenticationScriptBuilder

build() → {String}

Create the script string.
Returns:
The script
Type
String

denyAnonymousConnections() → {SystemAuthenticationScriptBuilder}

Instruct the system authentication to deny anonymous connections.
Returns:
A new builder containing the deny anonymous connections command.
Type
SystemAuthenticationScriptBuilder

removePrincipal(principal) → {SystemAuthenticationScriptBuilder}

Remove a principal.
Parameters:
Name Type Description
principal String The principal name
Returns:
A new builder containing the remove command
Type
SystemAuthenticationScriptBuilder

verifyPassword(principal, password) → {SystemAuthenticationScriptBuilder}

Assert that a principal's password is password.

This command doesn't update the store. It can be used in conjunction with SystemAuthenticationScriptBuilder#setPassword to create a script that updates a password only if the previous password is supplied.

Parameters:
Name Type Description
principal String The principal name
password String The principal's password
Returns:
A new builder containing the verification command
Type
SystemAuthenticationScriptBuilder