Removing prefix and suffix from User-Name
Seferovic Edvin
edvin.seferovic at kolp.at
Fri Sep 2 02:33:23 CEST 2005
Hi,
is this a typo ?
"\host\login.server.domain.com" to "username" <<< backslash
DEFAULT Prefix == "/host", Strip-User-Name = Yes <<< slash?
Regards,
Edvin Seferovic
-----Original Message-----
From: freeradius-users-bounces at lists.freeradius.org
[mailto:freeradius-users-bounces at lists.freeradius.org] On Behalf Of Jérémy
Cluzel
Sent: Freitag, 02. September 2005 02:05
To: freeradius-users at lists.freeradius.org
Subject: Removing prefix and suffix from User-Name
Hi,
I want to convert the User-Name recieved:
"\host\login.server.domain.com" to "username".
What's the best way to do this ?
- using preprocess module and "hints" file:
DEFAULT Prefix == "/host", Strip-User-Name = Yes
DEFAULT Suffix == ".server.domain.com", Strip-User-Name = Yes
- using "proxy.conf" file:
realm server.domain.com {
type = radius
authhost = LOCAL
accthost = LOCAL
}
- using realm module:
realm test {
format = suffix
delimiter = "."
ignore_default = no
ignore_null = no
}
- using attr_rewrite module:
attr_rewrite saneUserName {
attribute = User-Name
searchin = packet
searchfor = "^(+.).server.domain.com"
replacewith = "%{1}"
ignore_case = yes
new_attribute = no
max_matches = 1
append = no
}
- or using preprocess module and "hints" file:
DEFAULT Prefix == "/host", Strip-User-Name = Yes
DEFAULT Suffix == ".server.domain.com", Strip-User-Name = Yes
Regards,
Jeremy
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list