--- title: "system.security.validateUser" description: "Tests credentials (username and password) against an authentication profile." --- # system.security.validateUser > Tests credentials (username and password) against an authentication profile. This function is used in **Python Scripting**. ## Description Tests credentials (username and password) against an authentication profile (User Source). Returns a boolean based upon whether or not the authentication profile accepts the credentials. If the User Source name is omitted, then the current project's default authentication profile is used. ## Client Permission Restrictions This scripting function has no [Client Permission](ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax (Client) `system.security.validateUser(username, password, [authProfile], [timeout])` ### Parameters |Type | Parameter | Description | |------- | ------- | ------| |String| `username` | The username to validate.| |String| `password` | The password for the user.| |String| `authProfile` | The name of the authentication profile (User Source) to run against. Leaving this out will use the project's default profile. [optional]| |Integer| `timeout` | Timeout 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 |Type | Parameter | Description| |------- | ------- | ------| |String| `username` | The username to validate.| |String| `password` | The password for the user.| |String| `authProfile` | The name of the authentication profile (User Source) 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 ```python title="Code Snippet" # This would require the current user to enter their password again before proceeding. passMessage = "Confirm Password" passTitle = "Password Dialog Box" currentUser = system.vision.getUsername() password = system.vision.showPasswordInput(passMessage, passTitle) valid = system.security.validateUser(currentUser, password) # Decide what to do based off result: if valid: print("Validated!") else: system.vision.showError("Incorrect Password", "Wrong Password") ```