3.11.9. RewriteUsername Previous topic Parent topic Child topic Next topic

This parameter enables you to alter the user name in all authentication and accounting requests from this client before being despatched to any Realm or Handler. For more information, see Section 8. Rewriting user names.
You can have any number of RewriteUsername parameters. The rewrites will be applied to the user name in the same order that they appear in the configuration file. The rewrites are applied after any global rewrites, but before any per-Handler or per-Realm rewrites. At Trace level 4, you can see the result of each separate rewrite for debugging purposes.
# Convert all user@realm1 to user@realm2, then
# change any user named mikem into fred
RewriteUsername   s/^([^@]+)@realm1/$1@user.realm2/
RewriteUsername   s/^mikem@/fred@/

# Convert a MSN realm/user into user@realm
RewriteUsername   s/^(.*)\/(.*)/$2\@$1/

# Translate all uppercase to lowercase
RewriteUsername   tr/A-Z/a-z/