Removing prefix and suffix from User-Name

classic Classic list List threaded Threaded
2 messages Options
| Threaded
Open this post in threaded view
|

Removing prefix and suffix from User-Name

Jérémy Cluzel
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
| Threaded
Open this post in threaded view
|

RE: Removing prefix and suffix from User-Name

"Edvin Seferovic | Kolpinghaus St. Pölten"
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: [hidden email]
[mailto:[hidden email]] On Behalf Of Jérémy
Cluzel
Sent: Freitag, 02. September 2005 02:05
To: [hidden email]
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


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html