attr_rewrite

Kevin Bonner keb at pa.net
Mon Feb 19 22:55:28 CET 2007


On Monday 19 February 2007 15:29, Ben Butler wrote:
> Hi,
>
> I am having some problems with attr_rewrite.
>
> What I want to do is the following at a pre authorisation phase:
>
> User-Name = username at somedomain.com
>
> To
>
> User-Name = somedomain.com
>
> I want to call by attr_rewrite function for each of the domains that I want
> to stip the username from prior to authorisation.

I'm not very familiar with attr_rewrite, so I'm posting what I would do if I 
were presented with this issue.

We use the hints file to rewrite the request username, as needed.  A hints 
file example that should do what you want:

DEFAULT User-Name =~ "^.*@somedomain.com$"
        User-Name := "somedomain.com"

Then just define somedomain.com in your users file (or DB) and process it like 
a normal request.

Kevin Bonner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20070219/3af4b795/attachment.pgp>


More information about the Freeradius-Users mailing list