Skip to main content
Version: 8.1

system.security.validateUser

This function is used in Python Scripting.

Description​

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.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax (Client)​

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

Parameters​

TypeParameterDescription
StringusernameThe username to validate
StringpasswordThe password for the user
StringauthProfileThe name of the authentication profile to run against. Leaving this out will use the project's default profile. [optional]
IntegertimeoutTimeout for Client-to-Gateway communication. Default is 60,000ms. [optional]

Returns​

Boolean - False if the user failed to authenticate; True if the username/password was a valid combination.

Scope​

Vision Client

Syntax (Gateway)​

system.security.validateUser(username, password, [authProfile])

Parameters​

TypeParameterDescription
StringusernameThe username to validate.
StringpasswordThe password for the user.
StringauthProfileThe name of the authentication profile to run against. Optional. Leaving this out will use the project's default profile. [optional]

Returns​

Boolean - False if the user failed to authenticate; True if the username/password was a valid combination.

Scope​

Gateway, Perspective Session

Code Example​

Code Snippet
# 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")