Forum Discussion
nirobi03_194837
Nimbostratus
Nov 24, 2015Can I enforce a maximum character limit for APM user name?
I would like to limit the username field to no more than 7 characters to prevent users from accidently putting their username and password in the username field.
Is this possible?
If so, ho...
Lucas_Thompson_
Nov 25, 2015Historic F5 Account
With APM you can basically do anything because you can stick TCL anywhere you want. Here's how to do that:
- Go to VPE in your access policy
- Add (or edit) a logon page Policy Item.
- Add a branch rule
- Add whatever expression you want (it doesn't matter, we're going to edit it)
- Click the Advanced tab
- Use this expression: expr { [string length [mcget {session.logon.last.username}]] > 7 }
The system evaluates that from the innermost square brackets out, like algebra. "string length" is TCL to grab the length of a string. "mcget" grabs a session variable from APD's cache (or sessiondb, depending). "expr" evaluates the expression mathematically.
- expr { [string length [mcget {session.logon.last.username}]] > 7 }
- expr { [string length "johndoe"] > 7 }
- expr { 7 > 7 }
- expr { 0 }
- Result: FALSE
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects