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. -
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 -
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. -
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 -
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. -
removePrincipal(principal) → {SystemAuthenticationScriptBuilder}
-
Remove a principal.
Parameters:
Name Type Description principal
String The principal name Returns:
A new builder containing the remove command -
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