Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Scripting_function



Panel
titleDescription

Tests credentials (username and password) against an authentication profile. Returns a boolean based upon whether or not the authentication profile accepts the credentials. If the authentication profile name is omitted, then the current project's default authentication profile is used.


Panel
titleClient Permission Restrictions

This scripting function has no Client Permission restrictions.


Panel
titleSyntax

system.security.validateUser(username, password, authProfile, timeout)

  • Parameters

String username - The username to validate

String password - The password for the user

String authProfile - The name of the authentication profile to run against. Optional. Leaving this out will use the project's default profile.

Integer timeout - Timeout for client-to-gateway communication. (default: 60,000ms)

  • Returns

boolean - false(0) if the user failed to authenticate, true(1) if the username/password was a valid combination.

  • Scope

Client


Panel
titleSyntax

system.security.validateUser(username, password, authProfile, timeout)

  • Parameters

String username - User name to validate. Required.

String password - User's password. Required.

String authProfile - Authorization profile to user for validation.

Integer timeout - Not used in gateway scripts.

  • Returns

boolean - True if valid username/password combination.

  • Scope

Gateway



Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
#This# This would require the current user to enter their password again before proceeding.
 
currentUser = system.security.getUsername()
password = system.gui.passwordBox("Confirm Password")
valid = system.security.validateUser(currentUser, password)
if valid:
   # do something
else:
   system.gui.errorBox("Incorrect password")